mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 07:56:17 +01:00
GHashTable: statically assert that GHashTableIter works as intended
https://bugzilla.gnome.org/show_bug.cgi?id=688406
This commit is contained in:
parent
476aa9ae46
commit
a4480d5f71
@ -34,6 +34,7 @@
|
||||
|
||||
#include "ghash.h"
|
||||
|
||||
#include "glib-private.h"
|
||||
#include "gstrfuncs.h"
|
||||
#include "gatomic.h"
|
||||
#include "gtestutils.h"
|
||||
@ -246,6 +247,9 @@ typedef struct
|
||||
int version;
|
||||
} RealIter;
|
||||
|
||||
G_STATIC_ASSERT (sizeof (GHashTableIter) == sizeof (RealIter));
|
||||
G_STATIC_ASSERT (_g_alignof (GHashTableIter) >= _g_alignof (RealIter));
|
||||
|
||||
/* Each table size has an associated prime modulo (the first prime
|
||||
* lower than the table size) used to find the initial bucket. Probing
|
||||
* then works modulo 2^n. The prime modulo is necessary to get a
|
||||
|
Loading…
Reference in New Issue
Block a user