mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-12-11 19:13:02 +01:00
Merge branch 'ghash-gvariant-cheri-layout' into 'main'
Make GVariant/GHash opaque types compatible with CHERI See merge request GNOME/glib!3146
This commit is contained in:
@@ -251,7 +251,8 @@
|
|||||||
#define BIG_ENTRY_SIZE (SIZEOF_VOID_P)
|
#define BIG_ENTRY_SIZE (SIZEOF_VOID_P)
|
||||||
#define SMALL_ENTRY_SIZE (SIZEOF_INT)
|
#define SMALL_ENTRY_SIZE (SIZEOF_INT)
|
||||||
|
|
||||||
#if SMALL_ENTRY_SIZE < BIG_ENTRY_SIZE
|
/* NB: The USE_SMALL_ARRAYS code assumes pointers are at most 8 bytes. */
|
||||||
|
#if SMALL_ENTRY_SIZE < BIG_ENTRY_SIZE && BIG_ENTRY_SIZE <= 8
|
||||||
# define USE_SMALL_ARRAYS
|
# define USE_SMALL_ARRAYS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -292,7 +293,7 @@ typedef struct
|
|||||||
gpointer dummy2;
|
gpointer dummy2;
|
||||||
gint position;
|
gint position;
|
||||||
gboolean dummy3;
|
gboolean dummy3;
|
||||||
gint version;
|
gintptr version;
|
||||||
} RealIter;
|
} RealIter;
|
||||||
|
|
||||||
G_STATIC_ASSERT (sizeof (GHashTableIter) == sizeof (RealIter));
|
G_STATIC_ASSERT (sizeof (GHashTableIter) == sizeof (RealIter));
|
||||||
|
|||||||
@@ -2951,6 +2951,8 @@ struct heap_iter
|
|||||||
gsize magic;
|
gsize magic;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
G_STATIC_ASSERT (sizeof (struct heap_iter) <= sizeof (GVariantIter));
|
||||||
|
|
||||||
#define GVSI(i) ((struct stack_iter *) (i))
|
#define GVSI(i) ((struct stack_iter *) (i))
|
||||||
#define GVHI(i) ((struct heap_iter *) (i))
|
#define GVHI(i) ((struct heap_iter *) (i))
|
||||||
#define GVSI_MAGIC ((gsize) 3579507750u)
|
#define GVSI_MAGIC ((gsize) 3579507750u)
|
||||||
@@ -3220,7 +3222,7 @@ struct heap_builder
|
|||||||
|
|
||||||
/* Just to make sure that by adding a union to GVariantBuilder, we
|
/* Just to make sure that by adding a union to GVariantBuilder, we
|
||||||
* didn't accidentally change ABI. */
|
* didn't accidentally change ABI. */
|
||||||
G_STATIC_ASSERT (sizeof (GVariantBuilder) == sizeof (gsize[16]));
|
G_STATIC_ASSERT (sizeof (GVariantBuilder) == sizeof (guintptr[16]));
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
ensure_valid_builder (GVariantBuilder *builder)
|
ensure_valid_builder (GVariantBuilder *builder)
|
||||||
@@ -3907,7 +3909,7 @@ struct heap_dict
|
|||||||
|
|
||||||
/* Just to make sure that by adding a union to GVariantDict, we didn't
|
/* Just to make sure that by adding a union to GVariantDict, we didn't
|
||||||
* accidentally change ABI. */
|
* accidentally change ABI. */
|
||||||
G_STATIC_ASSERT (sizeof (GVariantDict) == sizeof (gsize[16]));
|
G_STATIC_ASSERT (sizeof (GVariantDict) == sizeof (guintptr[16]));
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
ensure_valid_dict (GVariantDict *dict)
|
ensure_valid_dict (GVariantDict *dict)
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ GVariant * g_variant_new_from_data (const G
|
|||||||
typedef struct _GVariantIter GVariantIter;
|
typedef struct _GVariantIter GVariantIter;
|
||||||
struct _GVariantIter {
|
struct _GVariantIter {
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
gsize x[16];
|
guintptr x[16];
|
||||||
};
|
};
|
||||||
|
|
||||||
GLIB_AVAILABLE_IN_ALL
|
GLIB_AVAILABLE_IN_ALL
|
||||||
@@ -304,9 +304,9 @@ struct _GVariantBuilder {
|
|||||||
struct {
|
struct {
|
||||||
gsize partial_magic;
|
gsize partial_magic;
|
||||||
const GVariantType *type;
|
const GVariantType *type;
|
||||||
gsize y[14];
|
guintptr y[14];
|
||||||
} s;
|
} s;
|
||||||
gsize x[16];
|
guintptr x[16];
|
||||||
} u;
|
} u;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -453,9 +453,9 @@ struct _GVariantDict {
|
|||||||
struct {
|
struct {
|
||||||
GVariant *asv;
|
GVariant *asv;
|
||||||
gsize partial_magic;
|
gsize partial_magic;
|
||||||
gsize y[14];
|
guintptr y[14];
|
||||||
} s;
|
} s;
|
||||||
gsize x[16];
|
guintptr x[16];
|
||||||
} u;
|
} u;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user