Lines Matching refs:size
61 #define malloc(size) tc_malloc(size) argument
62 #define calloc(count,size) tc_calloc(count,size) argument
63 #define realloc(ptr,size) tc_realloc(ptr,size) argument
66 #define malloc(size) je_malloc(size) argument
67 #define calloc(count,size) je_calloc(count,size) argument
68 #define realloc(ptr,size) je_realloc(ptr,size) argument
70 #define mallocx(size,flags) je_mallocx(size,flags) argument
89 static void zmalloc_default_oom(size_t size) { in zmalloc_default_oom() argument
91 size); in zmalloc_default_oom()
98 void *zmalloc(size_t size) { in zmalloc() argument
99 void *ptr = malloc(size+PREFIX_SIZE); in zmalloc()
101 if (!ptr) zmalloc_oom_handler(size); in zmalloc()
106 *((size_t*)ptr) = size; in zmalloc()
107 update_zmalloc_stat_alloc(size+PREFIX_SIZE); in zmalloc()
116 void *zmalloc_no_tcache(size_t size) { in zmalloc_no_tcache() argument
117 void *ptr = mallocx(size+PREFIX_SIZE, MALLOCX_TCACHE_NONE); in zmalloc_no_tcache()
118 if (!ptr) zmalloc_oom_handler(size); in zmalloc_no_tcache()
130 void *zcalloc(size_t size) { in zcalloc() argument
131 void *ptr = calloc(1, size+PREFIX_SIZE); in zcalloc()
133 if (!ptr) zmalloc_oom_handler(size); in zcalloc()
138 *((size_t*)ptr) = size; in zcalloc()
139 update_zmalloc_stat_alloc(size+PREFIX_SIZE); in zcalloc()
144 void *zrealloc(void *ptr, size_t size) { in zrealloc() argument
151 if (ptr == NULL) return zmalloc(size); in zrealloc()
154 newptr = realloc(ptr,size); in zrealloc()
155 if (!newptr) zmalloc_oom_handler(size); in zrealloc()
163 newptr = realloc(realptr,size+PREFIX_SIZE); in zrealloc()
164 if (!newptr) zmalloc_oom_handler(size); in zrealloc()
166 *((size_t*)newptr) = size; in zrealloc()
168 update_zmalloc_stat_alloc(size+PREFIX_SIZE); in zrealloc()
179 size_t size = *((size_t*)realptr); in zmalloc_size() local
182 if (size&(sizeof(long)-1)) size += sizeof(long)-(size&(sizeof(long)-1)); in zmalloc_size()
183 return size+PREFIX_SIZE; in zmalloc_size()
409 int64_t size = 0; /* 64-bit */ in zmalloc_get_memory_size() local
410 size_t len = sizeof(size); in zmalloc_get_memory_size()
411 if (sysctl( mib, 2, &size, &len, NULL, 0) == 0) in zmalloc_get_memory_size()
412 return (size_t)size; in zmalloc_get_memory_size()
428 unsigned int size = 0; /* 32-bit */ in zmalloc_get_memory_size()
429 size_t len = sizeof(size); in zmalloc_get_memory_size()
430 if (sysctl(mib, 2, &size, &len, NULL, 0) == 0) in zmalloc_get_memory_size()
431 return (size_t)size; in zmalloc_get_memory_size()