Skip to content

Commit a9df724

Browse files
Fix debug constants.
1 parent 925b47d commit a9df724

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ext/memory/profiler/capture.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
enum {
1515
DEBUG = 0,
16-
DEBUG_FREED_QUEUE = 0,
16+
DEBUG_EVENT_QUEUES = 0,
1717
DEBUG_STATE = 0,
1818
};
1919

@@ -235,7 +235,7 @@ static void Memory_Profiler_Capture_process_queues(void *arg) {
235235
struct Memory_Profiler_Capture *capture;
236236
TypedData_Get_Struct(self, struct Memory_Profiler_Capture, &Memory_Profiler_Capture_type, capture);
237237

238-
if (DEBUG_FREED_QUEUE) fprintf(stderr, "Processing queues: %zu newobj, %zu freeobj\n",
238+
if (DEBUG_EVENT_QUEUES) fprintf(stderr, "Processing queues: %zu newobj, %zu freeobj\n",
239239
capture->newobj_queue.count, capture->freeobj_queue.count);
240240

241241
// Disable tracking during queue processing to prevent infinite loop
@@ -308,18 +308,18 @@ static void Memory_Profiler_Capture_newobj_handler(VALUE self, struct Memory_Pro
308308
// NOTE: realloc is safe during allocation (doesn't trigger Ruby allocation)
309309
struct Memory_Profiler_Newobj_Queue_Item *newobj = Memory_Profiler_Queue_push(&capture->newobj_queue);
310310
if (newobj) {
311-
if (DEBUG_FREED_QUEUE) fprintf(stderr, "Queued newobj, queue size now: %zu/%zu\n",
311+
if (DEBUG_EVENT_QUEUES) fprintf(stderr, "Queued newobj, queue size now: %zu/%zu\n",
312312
capture->newobj_queue.count, capture->newobj_queue.capacity);
313313
// Write directly to the allocated space
314314
newobj->klass = klass;
315315
newobj->allocations = allocations;
316316
newobj->object = object;
317317

318318
// Trigger postponed job to process the queue
319-
if (DEBUG_FREED_QUEUE) fprintf(stderr, "Triggering postponed job to process queues\n");
319+
if (DEBUG_EVENT_QUEUES) fprintf(stderr, "Triggering postponed job to process queues\n");
320320
rb_postponed_job_trigger(capture->postponed_job_handle);
321321
} else {
322-
if (DEBUG_FREED_QUEUE) fprintf(stderr, "Failed to queue newobj, out of memory\n");
322+
if (DEBUG_EVENT_QUEUES) fprintf(stderr, "Failed to queue newobj, out of memory\n");
323323
}
324324
// If push failed (out of memory), silently drop this newobj event
325325
}
@@ -366,18 +366,18 @@ static void Memory_Profiler_Capture_freeobj_handler(VALUE self, struct Memory_Pr
366366
// NOTE: realloc is safe during GC (doesn't trigger Ruby allocation)
367367
struct Memory_Profiler_Freeobj_Queue_Item *freed = Memory_Profiler_Queue_push(&capture->freeobj_queue);
368368
if (freed) {
369-
if (DEBUG_FREED_QUEUE) fprintf(stderr, "Queued freed object, queue size now: %zu/%zu\n",
369+
if (DEBUG_EVENT_QUEUES) fprintf(stderr, "Queued freed object, queue size now: %zu/%zu\n",
370370
capture->freeobj_queue.count, capture->freeobj_queue.capacity);
371371
// Write directly to the allocated space
372372
freed->klass = klass;
373373
freed->allocations = allocations;
374374
freed->state = state;
375375

376376
// Trigger postponed job to process both queues after GC
377-
if (DEBUG_FREED_QUEUE) fprintf(stderr, "Triggering postponed job to process queues after GC\n");
377+
if (DEBUG_EVENT_QUEUES) fprintf(stderr, "Triggering postponed job to process queues after GC\n");
378378
rb_postponed_job_trigger(capture->postponed_job_handle);
379379
} else {
380-
if (DEBUG_FREED_QUEUE) fprintf(stderr, "Failed to queue freed object, out of memory\n");
380+
if (DEBUG_EVENT_QUEUES) fprintf(stderr, "Failed to queue freed object, out of memory\n");
381381
}
382382
// If push failed (out of memory), silently drop this freeobj event
383383
}

0 commit comments

Comments
 (0)