mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-30 19:06:38 +02:00
ghash: Fix entry_is_big for CHERI architecture
The entry_is_big function checks if an entry fits into a so-called small entry, i.e. into a guint. This optimizes space for hash tables on 64 bit system with hash tables containing 32 bit entries. This code actually checks if the highest 32 bits are set, which would become an issue with CHERI and its 128 bit pointers. Helps: #2842
This commit is contained in:
@@ -873,7 +873,7 @@ g_hash_table_maybe_resize (GHashTable *hash_table)
|
||||
static inline gboolean
|
||||
entry_is_big (gpointer v)
|
||||
{
|
||||
return (((guintptr) v) >> ((BIG_ENTRY_SIZE - SMALL_ENTRY_SIZE) * 8)) != 0;
|
||||
return (((guintptr) v) >> (SMALL_ENTRY_SIZE * 8)) != 0;
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
|
Reference in New Issue
Block a user