Skip to content

Commit c0ccf7c

Browse files
committed
address clanker review comments
1 parent 8dc3819 commit c0ccf7c

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

libdd-profiling-heap-sampler/include/datadog/heap/probes.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,15 @@
3131
*/
3232
void dd_probe_alloc(void *user, uint64_t size, uint64_t weight);
3333

34-
#if DD_HEAP_LIVE_TRACKING
3534
/*
3635
* Emits the `ddheap:free` USDT.
3736
* ptr - user-visible pointer being freed
3837
*
39-
* Only available when compiled with live-heap tracking. The absence of
40-
* the `ddheap:free` note in .note.stapsdt signals to external profilers
41-
* that this binary does not support live-heap correlation.
38+
* The symbol always exists, but the USDT is only emitted when compiled
39+
* with live-heap tracking. The absence of the `ddheap:free` note in
40+
* .note.stapsdt signals to external profilers that this binary does not
41+
* support live-heap correlation.
4242
*/
4343
void dd_probe_free(void *ptr);
44-
#endif
4544

4645
#endif

libdd-profiling-heap-sampler/src/probes.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ void dd_probe_alloc(void *user, uint64_t size, uint64_t weight) {
2323
USDT(ddheap, alloc, user, size, weight);
2424
}
2525

26-
#if DD_HEAP_LIVE_TRACKING
2726
void dd_probe_free(void *ptr) {
27+
#if DD_HEAP_LIVE_TRACKING
2828
USDT(ddheap, free, ptr);
29-
}
30-
#endif
29+
#else
30+
(void)ptr;
31+
#endif
32+
}

0 commit comments

Comments
 (0)