Lines Matching refs:bytes
91 void* debug_memalign(size_t alignment, size_t bytes);
92 void* debug_realloc(void* pointer, size_t bytes);
93 void* debug_calloc(size_t nmemb, size_t bytes);
104 void* debug_pvalloc(size_t bytes);
460 size_t bytes = InternalMallocUsableSize(pointer); in InternalMalloc() local
462 bytes = (bytes < fill_bytes) ? bytes : fill_bytes; in InternalMalloc()
463 memset(pointer, g_debug->config().fill_alloc_value(), bytes); in InternalMalloc()
494 size_t bytes; in InternalFree() local
513 bytes = header->usable_size; in InternalFree()
515 bytes = g_dispatch->malloc_usable_size(pointer); in InternalFree()
520 bytes = (bytes < fill_bytes) ? bytes : fill_bytes; in InternalFree()
521 memset(pointer, g_debug->config().fill_free_value(), bytes); in InternalFree()
565 void* debug_memalign(size_t alignment, size_t bytes) { in debug_memalign() argument
567 return g_dispatch->memalign(alignment, bytes); in debug_memalign()
573 if (bytes == 0) { in debug_memalign()
574 bytes = 1; in debug_memalign()
577 if (bytes > PointerInfoType::MaxSize()) { in debug_memalign()
597 size_t real_size = alignment + bytes + g_debug->extra_bytes(); in debug_memalign()
598 if (real_size < bytes) { in debug_memalign()
614 pointer = InitHeader(header, pointer, bytes); in debug_memalign()
616 size_t real_size = bytes + g_debug->extra_bytes(); in debug_memalign()
617 if (real_size < bytes) { in debug_memalign()
627 PointerData::Add(pointer, bytes); in debug_memalign()
631 size_t bytes = InternalMallocUsableSize(pointer); in debug_memalign() local
633 bytes = (bytes < fill_bytes) ? bytes : fill_bytes; in debug_memalign()
634 memset(pointer, g_debug->config().fill_alloc_value(), bytes); in debug_memalign()
638 g_debug->record->AddEntry(new MemalignEntry(pointer, bytes, alignment)); in debug_memalign()
645 void* debug_realloc(void* pointer, size_t bytes) { in debug_realloc() argument
647 return g_dispatch->realloc(pointer, bytes); in debug_realloc()
654 pointer = InternalMalloc(bytes); in debug_realloc()
656 g_debug->record->AddEntry(new ReallocEntry(pointer, bytes, nullptr)); in debug_realloc()
665 if (bytes == 0) { in debug_realloc()
667 g_debug->record->AddEntry(new ReallocEntry(nullptr, bytes, pointer)); in debug_realloc()
674 size_t real_size = bytes; in debug_realloc()
677 if (real_size < bytes) { in debug_realloc()
684 if (bytes > PointerInfoType::MaxSize()) { in debug_realloc()
722 new_pointer = InternalMalloc(bytes); in debug_realloc()
748 size_t bytes = InternalMallocUsableSize(new_pointer); in debug_realloc() local
749 if (bytes > g_debug->config().fill_on_alloc_bytes()) { in debug_realloc()
750 bytes = g_debug->config().fill_on_alloc_bytes(); in debug_realloc()
752 if (bytes > prev_size) { in debug_realloc()
754 g_debug->config().fill_alloc_value(), bytes - prev_size); in debug_realloc()
759 g_debug->record->AddEntry(new ReallocEntry(new_pointer, bytes, pointer)); in debug_realloc()
765 void* debug_calloc(size_t nmemb, size_t bytes) { in debug_calloc() argument
767 return g_dispatch->calloc(nmemb, bytes); in debug_calloc()
774 if (__builtin_mul_overflow(nmemb, bytes, &size)) { in debug_calloc()
811 g_debug->record->AddEntry(new CallocEntry(pointer, bytes, nmemb)); in debug_calloc()
937 void* debug_pvalloc(size_t bytes) { in debug_pvalloc() argument
939 return g_dispatch->pvalloc(bytes); in debug_pvalloc()
943 size_t size = __BIONIC_ALIGN(bytes, pagesize); in debug_pvalloc()
944 if (size < bytes) { in debug_pvalloc()