30 |
30 |
31 #include <errno.h> |
31 #include <errno.h> |
32 |
32 |
33 __attribute__((__malloc__, __alloc_size__(2))) |
33 __attribute__((__malloc__, __alloc_size__(2))) |
34 static void *cx_malloc_stdlib( |
34 static void *cx_malloc_stdlib( |
35 __attribute__((__unused__)) void *d, |
35 cx_attr_unused void *d, |
36 size_t n |
36 size_t n |
37 ) { |
37 ) { |
38 return malloc(n); |
38 return malloc(n); |
39 } |
39 } |
40 |
40 |
41 __attribute__((__warn_unused_result__, __alloc_size__(3))) |
41 __attribute__((__warn_unused_result__, __alloc_size__(3))) |
42 static void *cx_realloc_stdlib( |
42 static void *cx_realloc_stdlib( |
43 __attribute__((__unused__)) void *d, |
43 cx_attr_unused void *d, |
44 void *mem, |
44 void *mem, |
45 size_t n |
45 size_t n |
46 ) { |
46 ) { |
47 return realloc(mem, n); |
47 return realloc(mem, n); |
48 } |
48 } |
49 |
49 |
50 __attribute__((__malloc__, __alloc_size__(2, 3))) |
50 __attribute__((__malloc__, __alloc_size__(2, 3))) |
51 static void *cx_calloc_stdlib( |
51 static void *cx_calloc_stdlib( |
52 __attribute__((__unused__)) void *d, |
52 cx_attr_unused void *d, |
53 size_t nelem, |
53 size_t nelem, |
54 size_t n |
54 size_t n |
55 ) { |
55 ) { |
56 return calloc(nelem, n); |
56 return calloc(nelem, n); |
57 } |
57 } |
58 |
58 |
59 __attribute__((__nonnull__)) |
59 __attribute__((__nonnull__)) |
60 static void cx_free_stdlib( |
60 static void cx_free_stdlib( |
61 __attribute__((__unused__)) void *d, |
61 cx_attr_unused void *d, |
62 void *mem |
62 void *mem |
63 ) { |
63 ) { |
64 free(mem); |
64 free(mem); |
65 } |
65 } |
66 |
66 |