aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_db_hash.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-05-02 17:33:28 +0200
committerSverker Eriksson <[email protected]>2018-05-08 14:38:42 +0200
commit1005ffd33c7110f2097f711b6e9e07fbb9ae1d32 (patch)
tree45faca7c4997e90527a9f8b9dbeb1dead9013cf6 /erts/emulator/beam/erl_db_hash.h
parent3ab4ac0371b8646246c8b029dd89f39c3a6981b4 (diff)
downloadotp-1005ffd33c7110f2097f711b6e9e07fbb9ae1d32.tar.gz
otp-1005ffd33c7110f2097f711b6e9e07fbb9ae1d32.tar.bz2
otp-1005ffd33c7110f2097f711b6e9e07fbb9ae1d32.zip
erts: Refactor pseudo deleted ets objects
Separate pseudo-deleted-flag from the hash value.
Diffstat (limited to 'erts/emulator/beam/erl_db_hash.h')
-rw-r--r--erts/emulator/beam/erl_db_hash.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_db_hash.h b/erts/emulator/beam/erl_db_hash.h
index 5f88170ced..127512e1fe 100644
--- a/erts/emulator/beam/erl_db_hash.h
+++ b/erts/emulator/beam/erl_db_hash.h
@@ -28,9 +28,20 @@ typedef struct fixed_deletion {
struct fixed_deletion *next;
} FixedDeletion;
+
+typedef Uint32 HashVal;
+
typedef struct hash_db_term {
struct hash_db_term* next; /* next bucket */
- HashValue hvalue; /* stored hash value */
+#if SIZEOF_VOID_P == 4
+ Uint32 hvalue : 31; /* stored hash value */
+ Uint32 pseudo_deleted : 1;
+# define MAX_HASH_MASK (((Uint32)1 << 31)-1)
+#elif SIZEOF_VOID_P == 8
+ Uint32 hvalue;
+ Uint32 pseudo_deleted;
+# define MAX_HASH_MASK ((Uint32)(Sint32)-1)
+#endif
DbTerm dbterm; /* The actual term */
} HashDbTerm;