mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-09-21 01:36:15 +02: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 "ghash.h"
|
||||||
|
|
||||||
|
#include "glib-private.h"
|
||||||
#include "gstrfuncs.h"
|
#include "gstrfuncs.h"
|
||||||
#include "gatomic.h"
|
#include "gatomic.h"
|
||||||
#include "gtestutils.h"
|
#include "gtestutils.h"
|
||||||
@ -246,6 +247,9 @@ typedef struct
|
|||||||
int version;
|
int version;
|
||||||
} RealIter;
|
} 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
|
/* Each table size has an associated prime modulo (the first prime
|
||||||
* lower than the table size) used to find the initial bucket. Probing
|
* 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
|
* then works modulo 2^n. The prime modulo is necessary to get a
|
||||||
|
Loading…
Reference in New Issue
Block a user