libguac
1.5.5
Toggle main menu visibility
Main Page
Related Pages
Data Structures
Data Structures
Data Structure Index
Data Fields
All
a
b
c
d
e
f
g
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Variables
a
b
c
d
e
f
g
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Files
File List
Globals
All
a
c
e
g
h
l
m
p
r
s
t
u
w
Functions
a
c
h
p
r
s
t
u
w
Variables
Typedefs
a
c
s
t
u
Enumerations
Enumerator
g
Macros
e
g
m
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
Loading...
Searching...
No Matches
guacamole
mem.h
Go to the documentation of this file.
1
/*
2
* Licensed to the Apache Software Foundation (ASF) under one
3
* or more contributor license agreements. See the NOTICE file
4
* distributed with this work for additional information
5
* regarding copyright ownership. The ASF licenses this file
6
* to you under the Apache License, Version 2.0 (the
7
* "License"); you may not use this file except in compliance
8
* with the License. You may obtain a copy of the License at
9
*
10
* http://www.apache.org/licenses/LICENSE-2.0
11
*
12
* Unless required by applicable law or agreed to in writing,
13
* software distributed under the License is distributed on an
14
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
* KIND, either express or implied. See the License for the
16
* specific language governing permissions and limitations
17
* under the License.
18
*/
19
20
#ifndef GUAC_MEM_H
21
#define GUAC_MEM_H
22
31
#include "private/mem.h"
32
33
#include <stddef.h>
34
58
#define guac_mem_alloc(...) \
59
PRIV_guac_mem_alloc( \
60
sizeof((const size_t[]) { __VA_ARGS__ }) / sizeof(const size_t), \
61
(const size_t[]) { __VA_ARGS__ } \
62
)
58
#define guac_mem_alloc(...) \
…
63
87
#define guac_mem_zalloc(...) \
88
PRIV_guac_mem_zalloc( \
89
sizeof((const size_t[]) { __VA_ARGS__ }) / sizeof(const size_t), \
90
(const size_t[]) { __VA_ARGS__ } \
91
)
87
#define guac_mem_zalloc(...) \
…
92
125
#define guac_mem_ckd_mul(result, ...) \
126
PRIV_guac_mem_ckd_mul( \
127
result, \
128
sizeof((const size_t[]) { __VA_ARGS__ }) / sizeof(const size_t), \
129
(const size_t[]) { __VA_ARGS__ } \
130
)
125
#define guac_mem_ckd_mul(result, ...) \
…
131
164
#define guac_mem_ckd_add(result, ...) \
165
PRIV_guac_mem_ckd_add( \
166
result, \
167
sizeof((const size_t[]) { __VA_ARGS__ }) / sizeof(const size_t), \
168
(const size_t[]) { __VA_ARGS__ } \
169
)
164
#define guac_mem_ckd_add(result, ...) \
…
170
204
#define guac_mem_ckd_sub(result, ...) \
205
PRIV_guac_mem_ckd_sub( \
206
result, \
207
sizeof((const size_t[]) { __VA_ARGS__ }) / sizeof(const size_t), \
208
(const size_t[]) { __VA_ARGS__ } \
209
)
204
#define guac_mem_ckd_sub(result, ...) \
…
210
238
#define guac_mem_ckd_mul_or_die(...) \
239
PRIV_guac_mem_ckd_mul_or_die( \
240
sizeof((const size_t[]) { __VA_ARGS__ }) / sizeof(const size_t), \
241
(const size_t[]) { __VA_ARGS__ } \
242
)
238
#define guac_mem_ckd_mul_or_die(...) \
…
243
270
#define guac_mem_ckd_add_or_die(...) \
271
PRIV_guac_mem_ckd_add_or_die( \
272
sizeof((const size_t[]) { __VA_ARGS__ }) / sizeof(const size_t), \
273
(const size_t[]) { __VA_ARGS__ } \
274
)
270
#define guac_mem_ckd_add_or_die(...) \
…
275
303
#define guac_mem_ckd_sub_or_die(...) \
304
PRIV_guac_mem_ckd_sub_or_die( \
305
sizeof((const size_t[]) { __VA_ARGS__ }) / sizeof(const size_t), \
306
(const size_t[]) { __VA_ARGS__ } \
307
)
303
#define guac_mem_ckd_sub_or_die(...) \
…
308
340
#define guac_mem_realloc(mem, ...) \
341
PRIV_guac_mem_realloc( \
342
mem, \
343
sizeof((const size_t[]) { __VA_ARGS__ }) / sizeof(const size_t), \
344
(const size_t[]) { __VA_ARGS__ } \
345
)
340
#define guac_mem_realloc(mem, ...) \
…
346
377
#define guac_mem_realloc_or_die(mem, ...) \
378
PRIV_guac_mem_realloc_or_die( \
379
mem, \
380
sizeof((const size_t[]) { __VA_ARGS__ }) / sizeof(const size_t), \
381
(const size_t[]) { __VA_ARGS__ } \
382
)
377
#define guac_mem_realloc_or_die(mem, ...) \
…
383
394
#define guac_mem_free(mem) (PRIV_guac_mem_free(mem), (mem) = NULL, (void) 0)
395
410
#define guac_mem_free_const(mem) PRIV_guac_mem_free((void*) (mem))
411
412
#endif
413
Generated by
1.10.0