src/allocator.c

changeset 452
a10c3e127050
parent 450
7960298039cf
child 500
eb9e7bd40a8e
equal deleted inserted replaced
451:db06dda7ac4d 452:a10c3e127050
28 28
29 #include "cx/allocator.h" 29 #include "cx/allocator.h"
30 30
31 #include <stdlib.h> 31 #include <stdlib.h>
32 32
33 __attribute__((__malloc__)) 33 __attribute__((__malloc__, __alloc_size__(2)))
34 static void *cx_malloc_stdlib(__attribute__((__unused__)) void *d, size_t n) { 34 static void *cx_malloc_stdlib(__attribute__((__unused__)) void *d, size_t n) {
35 return malloc(n); 35 return malloc(n);
36 } 36 }
37 37
38 __attribute__((__warn_unused_result__)) 38 __attribute__((__warn_unused_result__, __alloc_size__(3)))
39 static void *cx_realloc_stdlib(__attribute__((__unused__)) void *d, void *mem, size_t n) { 39 static void *cx_realloc_stdlib(__attribute__((__unused__)) void *d, void *mem, size_t n) {
40 return realloc(mem, n); 40 return realloc(mem, n);
41 } 41 }
42 42
43 __attribute__((__malloc__)) 43 __attribute__((__malloc__, __alloc_size__(2, 3)))
44 static void *cx_calloc_stdlib(__attribute__((__unused__)) void *d, size_t nelem, size_t n) { 44 static void *cx_calloc_stdlib(__attribute__((__unused__)) void *d, size_t nelem, size_t n) {
45 return calloc(nelem, n); 45 return calloc(nelem, n);
46 } 46 }
47 47
48 __attribute__((__nonnull__)) 48 __attribute__((__nonnull__))

mercurial