mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-24 11:12:11 +01:00
GVariant: ensure GVariantIter alignment for CHERI systems
For CHERI-enabled architectures such as Arm Morello we have to align the GVariantIter to pointer alignment (16 bytes for Morello) but defining the opaque struct as 16 gsize elements only aligns to 8 bytes. This does not change the layout for existing architecutre since there gsize is the same as guintptr. Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
This commit is contained in:
parent
147777e342
commit
9f8edb1e3f
@ -2951,6 +2951,8 @@ struct heap_iter
|
||||
gsize magic;
|
||||
};
|
||||
|
||||
G_STATIC_ASSERT (sizeof (struct heap_iter) <= sizeof (GVariantIter));
|
||||
|
||||
#define GVSI(i) ((struct stack_iter *) (i))
|
||||
#define GVHI(i) ((struct heap_iter *) (i))
|
||||
#define GVSI_MAGIC ((gsize) 3579507750u)
|
||||
|
@ -270,7 +270,7 @@ GVariant * g_variant_new_from_data (const G
|
||||
typedef struct _GVariantIter GVariantIter;
|
||||
struct _GVariantIter {
|
||||
/*< private >*/
|
||||
gsize x[16];
|
||||
guintptr x[16];
|
||||
};
|
||||
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
|
Loading…
x
Reference in New Issue
Block a user