Lines Matching full:g_debug
51 DebugData* g_debug;
98 if (g_debug != nullptr) {
99 g_debug->PrepareFork();
103 if (g_debug != nullptr) {
104 g_debug->PostForkParent();
108 if (g_debug != nullptr) {
109 g_debug->PostForkChild();
122 if (g_debug->config().options & FREE_TRACK) {
123 g_debug->free_track->LogBacktrace(header);
148 header->usable_size -= g_debug->pointer_offset() +
151 if (g_debug->config().options & FRONT_GUARD) {
152 uint8_t* guard = g_debug->GetFrontGuard(header);
153 memset(guard, g_debug->config().front_guard_value, g_debug->config().front_guard_bytes);
156 if (g_debug->config().options & REAR_GUARD) {
157 uint8_t* guard = g_debug->GetRearGuard(header);
158 memset(guard, g_debug->config().rear_guard_value, g_debug->config().rear_guard_bytes);
165 if (g_debug->config().options & BACKTRACE) {
166 BacktraceHeader* back_header = g_debug->GetAllocBacktrace(header);
167 if (g_debug->backtrace->enabled()) {
170 &back_header->frames[0], g_debug->config().backtrace_frames);
177 if (g_debug->config().options & TRACK_ALLOCS) {
178 g_debug->track->Add(header, backtrace_found);
181 return g_debug->GetPointer(header);
205 g_debug = debug;
215 if (g_debug == nullptr) {
219 if (g_debug->config().options & FREE_TRACK) {
220 g_debug->free_track->VerifyAll(*g_debug);
223 if (g_debug->config().options & LEAK_TRACK) {
224 g_debug->track->DisplayLeaks(*g_debug);
231 delete g_debug;
232 g_debug = nullptr;
254 if (!(g_debug->config().options & BACKTRACE)) {
260 g_debug->track->GetInfo(*g_debug, info, overall_size, info_size, total_memory, backtrace_size);
268 if (DebugCallsDisabled() || !g_debug->need_header() || pointer == nullptr) {
272 Header* header = g_debug->GetHeader(pointer);
290 size_t real_size = size + g_debug->extra_bytes();
298 if (g_debug->need_header()) {
314 if (pointer != nullptr && g_debug->config().options & FILL_ON_ALLOC) {
316 size_t fill_bytes = g_debug->config().fill_on_alloc_bytes;
318 memset(pointer, g_debug->config().fill_alloc_value, bytes);
331 if (g_debug->need_header()) {
332 header = g_debug->GetHeader(pointer);
339 if (g_debug->config().options & FRONT_GUARD) {
340 if (!g_debug->front_guard->Valid(*g_debug, header)) {
341 g_debug->front_guard->LogFailure(*g_debug, header);
344 if (g_debug->config().options & REAR_GUARD) {
345 if (!g_debug->rear_guard->Valid(*g_debug, header)) {
346 g_debug->rear_guard->LogFailure(*g_debug, header);
350 if (g_debug->config().options & TRACK_ALLOCS) {
352 if (g_debug->config().options & BACKTRACE) {
353 BacktraceHeader* back_header = g_debug->GetAllocBacktrace(header);
356 g_debug->track->Remove(header, backtrace_found);
365 if (g_debug->config().options & FILL_ON_FREE) {
366 size_t fill_bytes = g_debug->config().fill_on_free_bytes;
368 memset(pointer, g_debug->config().fill_free_value, bytes);
371 if (g_debug->config().options & FREE_TRACK) {
377 g_debug->free_track->Add(*g_debug, header);
393 if (g_debug->need_header()) {
412 size_t real_size = alignment + bytes + g_debug->extra_bytes();
424 uintptr_t value = reinterpret_cast<uintptr_t>(pointer) + g_debug->pointer_offset();
428 Header* header = g_debug->GetHeader(reinterpret_cast<void*>(value));
431 size_t real_size = bytes + g_debug->extra_bytes();
440 if (pointer != nullptr && g_debug->config().options & FILL_ON_ALLOC) {
442 size_t fill_bytes = g_debug->config().fill_on_alloc_bytes;
444 memset(pointer, g_debug->config().fill_alloc_value, bytes);
464 if (g_debug->config().options & EXPAND_ALLOC) {
465 real_size += g_debug->config().expand_alloc_bytes;
475 if (g_debug->need_header()) {
481 Header* header = g_debug->GetHeader(pointer);
498 if (g_debug->config().options & REAR_GUARD) {
502 memset(g_debug->GetRearGuard(header), g_debug->config().rear_guard_value,
503 g_debug->config().rear_guard_bytes);
526 if (g_debug->config().options & FILL_ON_ALLOC) {
528 if (bytes > g_debug->config().fill_on_alloc_bytes) {
529 bytes = g_debug->config().fill_on_alloc_bytes;
533 g_debug->config().fill_alloc_value, bytes - prev_size);
557 g_debug->extra_bytes(), &real_size)) {
563 if (g_debug->need_header()) {
614 if (g_debug->need_header()) {
616 if (g_debug->config().options & TRACK_ALLOCS) {
617 if (g_debug->track->Contains(header)) {
619 ctx->callback(reinterpret_cast<uintptr_t>(g_debug->GetPointer(header)),
632 if (g_debug->track) {
633 g_debug->track->PrepareFork();
638 if (g_debug->track) {
639 g_debug->track->PostForkParent();
649 if (g_debug->need_header()) {
651 if (g_debug->config().options & TRACK_ALLOCS) {
652 header = g_debug->GetHeader(pointer);
653 if (!g_debug->track->Contains(header)) {
662 if (g_debug->config().options & BACKTRACE) {
663 BacktraceHeader* back_header = g_debug->GetAllocBacktrace(header);