Lines Matching refs:size
25 * |canary|size|memory...|canary|
30 * The 'size' stored is the size the user requested, not the size including
84 size_t size;
101 /* Adjust a size that is about to be passed to the real allocation functions in
104 static size_t adjust_size(size_t size)
106 return size + sizeof(metadata_t) + sizeof(uintptr_t);
110 static void *box(void *ptr, size_t size)
118 unaligned_uintptr_t *post = ptr + size;
122 pre->size = size;
149 unaligned_uintptr_t *post = ptr + pre->size;
159 * your buffer and overwrote the 'size' metadata, causing this function to
219 void *__real_malloc(size_t size);
221 void *__real_calloc(size_t num, size_t size);
222 void *__real_realloc(void *ptr, size_t size);
226 void *__wrap_malloc(size_t size)
229 return __real_malloc(size);
232 size_t new_size = adjust_size(size);
234 ptr = box(ptr, size);
252 * user underran their buffer and overwrote the 'size' metadata.
255 for (unsigned int i = 0; i < pre->size; i++) {
263 void *__wrap_calloc(size_t num, size_t size)
266 return __real_calloc(num, size);
269 size_t sz = adjust_size(num * size);
270 size_t new_num = sz / size;
271 if (sz % size != 0) {
275 void *ptr = __real_calloc(new_num, size);
276 ptr = box(ptr, num * size);
281 void *__wrap_realloc(void *ptr, size_t size)
284 return __real_realloc(ptr, size);
291 size_t new_size = adjust_size(size);
293 ptr = box(ptr, size);