mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-27 07:56:14 +01:00
GTree: Add a G_STATIC_ASSERT for MAX_GTREE_HEIGHT
Makes sure we don't accidentally set it too small and overflow a tree path array. Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
This commit is contained in:
parent
f08191e398
commit
faa11d0910
@ -69,6 +69,8 @@
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
#define MAX_GTREE_HEIGHT 40
|
#define MAX_GTREE_HEIGHT 40
|
||||||
|
/* G_MAXUINT nodes will be covered by tree height of log2(G_MAXUINT) + 2. */
|
||||||
|
G_STATIC_ASSERT ((G_GUINT64_CONSTANT (1) << (MAX_GTREE_HEIGHT - 2)) >= G_MAXUINT);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GTree:
|
* GTree:
|
||||||
|
Loading…
Reference in New Issue
Block a user