diff options
author | Sverker Eriksson <[email protected]> | 2018-05-18 14:33:52 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2018-05-18 14:33:52 +0200 |
commit | 6024dea0b587518aa222fa198f007d7e069a89b1 (patch) | |
tree | 44720659fa2061061095ad17956fda651af12a9d /erts/emulator/beam/erl_db_hash.h | |
parent | a01ffa40c55380a9749c17458d0156443e415b5e (diff) | |
parent | e7579f608a1bdb52271c57e9ad69a7752ea1371b (diff) | |
download | otp-6024dea0b587518aa222fa198f007d7e069a89b1.tar.gz otp-6024dea0b587518aa222fa198f007d7e069a89b1.tar.bz2 otp-6024dea0b587518aa222fa198f007d7e069a89b1.zip |
Merge branch 'sverker/ets-delete_all_objects-trap/OTP-15078'
* sverker/ets-delete_all_objects-trap/OTP-15078:
erts: Rename untrapping db_free_*empty*_table
erts: Make ets:delete_all_objects yield on fixed table
erts: Optimize ets delete all in fixed table
erts: Refactor ets select iteration code
erts: Cleanup ets code
erts: Optimize ets hash object deallocactions
erts: Refactor pseudo deleted ets objects
erts: Make atomic ets:delete_all_objects yield
erts: Fix reduction bump for ets:delete/1
Diffstat (limited to 'erts/emulator/beam/erl_db_hash.h')
-rw-r--r-- | erts/emulator/beam/erl_db_hash.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/erts/emulator/beam/erl_db_hash.h b/erts/emulator/beam/erl_db_hash.h index 7d27609825..08e5b13db1 100644 --- a/erts/emulator/beam/erl_db_hash.h +++ b/erts/emulator/beam/erl_db_hash.h @@ -24,13 +24,26 @@ #include "erl_db_util.h" /* DbTerm & DbTableCommon */ typedef struct fixed_deletion { - int slot; + UWord slot : sizeof(UWord)*8 - 2; + UWord all : 1; + UWord trap : 1; 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; @@ -86,9 +99,6 @@ int db_get_hash(Process *p, DbTable *tbl, Eterm key, Eterm *ret); int db_erase_hash(DbTable *tbl, Eterm key, Eterm *ret); -/* not yet in method table */ -int db_mark_all_deleted_hash(DbTable *tbl); - typedef struct { float avg_chain_len; float std_dev_chain_len; |