From b33c3e8af91974902dbe2f5d6a4e8927b7881e0a Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Thu, 5 Mar 2020 15:24:47 -0800 Subject: [PATCH] libsysprof-capture: add more assertions around alignment --- src/libsysprof-capture/sysprof-capture-types.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libsysprof-capture/sysprof-capture-types.h b/src/libsysprof-capture/sysprof-capture-types.h index f5e73c61..4798c7b0 100644 --- a/src/libsysprof-capture/sysprof-capture-types.h +++ b/src/libsysprof-capture/sysprof-capture-types.h @@ -346,7 +346,9 @@ G_STATIC_ASSERT (sizeof (SysprofCaptureMetadata) == 64); G_STATIC_ASSERT (sizeof (SysprofCaptureLog) == 64); G_STATIC_ASSERT (sizeof (SysprofCaptureFileChunk) == 284); G_STATIC_ASSERT (sizeof (SysprofCaptureAllocation) == 48); -G_STATIC_ASSERT ((G_STRUCT_OFFSET (SysprofCaptureAllocation, addrs) % 8) == 0); + +G_STATIC_ASSERT ((G_STRUCT_OFFSET (SysprofCaptureAllocation, addrs) % SYSPROF_CAPTURE_ALIGN) == 0); +G_STATIC_ASSERT ((G_STRUCT_OFFSET (SysprofCaptureSample, addrs) % SYSPROF_CAPTURE_ALIGN) == 0); static inline gint sysprof_capture_address_compare (SysprofCaptureAddress a,