We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
heap_frame
1 parent 7d0acaa commit 3a6b887Copy full SHA for 3a6b887
ext/datadog_profiling_native_extension/heap_recorder.c
@@ -41,6 +41,13 @@ typedef struct {
41
int32_t line;
42
} heap_frame;
43
44
+// We use memcmp/st_hash below to compare/hash an entire array of heap_frames, so want to make sure no padding is added
45
+// We could define the structure to be packed, but that seems even weirder across compilers, and this seems more portable?
46
+_Static_assert(
47
+ sizeof(heap_frame) == sizeof(ddog_prof_ManagedStringId) * 2 + sizeof(int32_t),
48
+ "Size of heap_frame does not match the sum of its members. Padding detected."
49
+);
50
+
51
// A compact representation of a stacktrace for a heap allocation.
52
// Used to dedup heap allocation stacktraces across multiple objects sharing the same allocation location.
53
typedef struct {
0 commit comments