Lines Matching refs:header
233 Header* header = g_debug->GetHeader(pointer); in VerifyPointer() local
234 if (header->tag != DEBUG_TAG) { in VerifyPointer()
236 if (header->tag == DEBUG_FREE_TAG) { in VerifyPointer()
239 error_str = android::base::StringPrintf("HAS INVALID TAG %" PRIx32 " (%s)", header->tag, in VerifyPointer()
265 static void* InitHeader(Header* header, void* orig_pointer, size_t size) { in InitHeader() argument
266 header->tag = DEBUG_TAG; in InitHeader()
267 header->orig_pointer = orig_pointer; in InitHeader()
268 header->size = size; in InitHeader()
269 header->usable_size = g_dispatch->malloc_usable_size(orig_pointer); in InitHeader()
270 if (header->usable_size == 0) { in InitHeader()
274 header->usable_size -= g_debug->pointer_offset() + reinterpret_cast<uintptr_t>(header) - in InitHeader()
278 uint8_t* guard = g_debug->GetFrontGuard(header); in InitHeader()
283 uint8_t* guard = g_debug->GetRearGuard(header); in InitHeader()
287 header->usable_size = header->size; in InitHeader()
290 return g_debug->GetPointer(header); in InitHeader()
444 Header* header = in InternalMalloc() local
446 if (header == nullptr) { in InternalMalloc()
449 pointer = InitHeader(header, header, size); in InternalMalloc()
495 Header* header; in InternalFree() local
497 header = g_debug->GetHeader(pointer); in InternalFree()
498 free_pointer = header->orig_pointer; in InternalFree()
501 if (!g_debug->front_guard->Valid(header)) { in InternalFree()
502 g_debug->front_guard->LogFailure(header); in InternalFree()
506 if (!g_debug->rear_guard->Valid(header)) { in InternalFree()
507 g_debug->rear_guard->LogFailure(header); in InternalFree()
511 header->tag = DEBUG_FREE_TAG; in InternalFree()
513 bytes = header->usable_size; in InternalFree()
613 Header* header = g_debug->GetHeader(reinterpret_cast<void*>(value)); in debug_memalign() local
614 pointer = InitHeader(header, pointer, bytes); in debug_memalign()
693 Header* header = g_debug->GetHeader(pointer); in debug_realloc() local
694 if (real_size == header->size) { in debug_realloc()
704 if (real_size < header->usable_size) { in debug_realloc()
705 header->size = real_size; in debug_realloc()
709 header->usable_size = header->size; in debug_realloc()
710 memset(g_debug->GetRearGuard(header), g_debug->config().rear_guard_value(), in debug_realloc()
728 prev_size = header->usable_size; in debug_realloc()
799 Header* header = in debug_calloc() local
801 if (header == nullptr) { in debug_calloc()
804 memset(header, 0, g_dispatch->malloc_usable_size(header)); in debug_calloc()
805 pointer = InitHeader(header, header, size); in debug_calloc()