preload: add assertion for performance hack

We steal two pointers temporarily, so ensure that we have the space to
overwrite a couple of addresses.
This commit is contained in:
Christian Hergert
2020-03-05 15:22:17 -08:00
parent 4af293a364
commit 6d8841267a

View File

@ -77,6 +77,10 @@ backtrace_func (SysprofCaptureAddress *addrs,
guint n_addrs,
gpointer user_data)
{
/* Ensure we have at least two pointers to steal temporarily below */
G_STATIC_ASSERT (G_STRUCT_OFFSET (SysprofCaptureSample, addrs) >= 16);
G_STATIC_ASSERT (G_STRUCT_OFFSET (SysprofCaptureAllocation, addrs) >= 16);
#if defined(ENABLE_LIBUNWIND)
# if GLIB_SIZEOF_VOID_P == 8
/* We know that collector will overwrite fields *AFTER* it