[sysprof] libsysprof-capture: add more assertions around alignment



commit b33c3e8af91974902dbe2f5d6a4e8927b7881e0a
Author: Christian Hergert <chergert redhat com>
Date:   Thu Mar 5 15:24:47 2020 -0800

    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 f5e73c6..4798c7b 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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]