diff options
author | Sverker Eriksson <[email protected]> | 2016-08-30 11:49:20 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-09-19 15:50:14 +0200 |
commit | 25eb3fe353cb0f5c381107e43a865d3a312c8c25 (patch) | |
tree | 3cb4f77871c759f2353e47f9d2cfe83ee9ed7c12 /erts/emulator/beam/erl_db.c | |
parent | 92c98a138638541a710f17f21073b568362502f8 (diff) | |
download | otp-25eb3fe353cb0f5c381107e43a865d3a312c8c25.tar.gz otp-25eb3fe353cb0f5c381107e43a865d3a312c8c25.tar.bz2 otp-25eb3fe353cb0f5c381107e43a865d3a312c8c25.zip |
erts: Suppress failed ETS memory checks
due to the grow/shrink hysteresis of the meta tables
Diffstat (limited to 'erts/emulator/beam/erl_db.c')
-rw-r--r-- | erts/emulator/beam/erl_db.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_db.c b/erts/emulator/beam/erl_db.c index bad34211a5..df4e34511f 100644 --- a/erts/emulator/beam/erl_db.c +++ b/erts/emulator/beam/erl_db.c @@ -3978,6 +3978,36 @@ erts_ets_colliding_names(Process* p, Eterm name, Uint cnt) return list; } +/* + * For testing only + * Retreive meta table size state + */ +Eterm erts_ets_get_meta_state(Process* p) +{ + Eterm* hp = HAlloc(p, 3); + return TUPLE2(hp, + erts_ets_hash_get_memstate(p, &meta_pid_to_tab->hash), + erts_ets_hash_get_memstate(p, &meta_pid_to_fixed_tab->hash)); +} +/* + * For testing only + * Restore a previously retrieved meta table size state. + * We do this to suppress failed memory checks + * caused by the hysteresis of meta tables grow/shrink limits. + */ +Eterm erts_ets_restore_meta_state(Process* p, Eterm meta_state) +{ + Eterm* tv; + Eterm* hp; + if (!is_tuple_arity(meta_state, 2)) + return am_badarg; + + tv = tuple_val(meta_state); + hp = HAlloc(p, 3); + return TUPLE2(hp, + erts_ets_hash_restore_memstate(&meta_pid_to_tab->hash, tv[1]), + erts_ets_hash_restore_memstate(&meta_pid_to_fixed_tab->hash, tv[2])); +} #ifdef HARDDEBUG /* Here comes some debug functions */ |