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:
Tobias Stoeckmann
2025-08-25 18:20:47 +02:00
parent 2735b2b331
commit cf97e674ab

View File

@@ -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