Home | History | Annotate | Download | only in bionic

Lines Matching defs:bytes

336     size_t offset, bytes;
340 /* first check the bytes in the sentinel header */
346 "corrupted %d bytes before allocation",
355 bytes = *(size_t *)(buffer + offset);
357 buf = (char*)mem + bytes;
362 "corrupted %d bytes after allocation",
363 func, buffer, bytes, i+1);
368 *allocated = bytes;
373 void* chk_malloc(size_t bytes)
375 char* buffer = (char*)dlmalloc(bytes + CHK_OVERHEAD_SIZE);
377 memset(buffer, CHK_SENTINEL_VALUE, bytes + CHK_OVERHEAD_SIZE);
379 *(size_t *)(buffer + offset) = bytes;
418 void* chk_realloc(void* mem, size_t bytes)
429 char* new_buffer = chk_malloc(bytes);
435 if (bytes > old_bytes)
436 bytes = old_bytes;
437 memcpy(new_buffer, mem, bytes);
444 void* chk_memalign(size_t alignment, size_t bytes)
447 return chk_malloc(bytes);
454 void* fill_malloc(size_t bytes)
456 void* buffer = dlmalloc(bytes);
458 memset(buffer, CHK_SENTINEL_VALUE, bytes);
465 size_t bytes = dlmalloc_usable_size(mem);
466 memset(mem, CHK_FILL_FREE, bytes);
470 void* fill_realloc(void* mem, size_t bytes)
472 void* buffer = fill_malloc(bytes);
478 size_t size = (bytes < old_size)?(bytes):(old_size);
485 void* fill_memalign(size_t alignment, size_t bytes)
487 void* buffer = dlmemalign(alignment, bytes);
489 memset(buffer, CHK_SENTINEL_VALUE, bytes);
500 void* leak_malloc(size_t bytes)
508 void* base = dlmalloc(bytes + sizeof(AllocationEntry));
516 header->entry = record_backtrace(backtrace, numEntries, bytes);
520 // this should just work since our header is 8 bytes.
583 void* leak_realloc(void* oldMem, size_t bytes)
586 return leak_malloc(bytes);
592 newMem = leak_malloc(bytes);
594 size_t copySize = (oldSize <= bytes) ? oldSize : bytes;
599 newMem = dlrealloc(oldMem, bytes);
604 void* leak_memalign(size_t alignment, size_t bytes)
608 return leak_malloc(bytes);
614 // here, aligment is at least MALLOC_ALIGNMENT<<1 bytes
615 // we will align by at least MALLOC_ALIGNMENT bytes
616 // and at most alignment-MALLOC_ALIGNMENT bytes
617 size_t size = (alignment-MALLOC_ALIGNMENT) + bytes;