aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_db.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-09-21 15:50:48 +0200
committerSverker Eriksson <[email protected]>2016-09-21 15:50:48 +0200
commite8411511fdb2a830b284e3a37ca8a2dc749ff79f (patch)
treea5bda7b07281176fa3452a1fb36526761fd97003 /erts/emulator/beam/erl_db.c
parentd419183bb3d2204144492104f6f33a5753127b12 (diff)
parentd100187bde4f3f555b4f3cd9561ec8c67a528895 (diff)
downloadotp-e8411511fdb2a830b284e3a37ca8a2dc749ff79f.tar.gz
otp-e8411511fdb2a830b284e3a37ca8a2dc749ff79f.tar.bz2
otp-e8411511fdb2a830b284e3a37ca8a2dc749ff79f.zip
Merge branch 'sverker/ets-load-factor/OTP-13903'
* sverker/ets-load-factor: erts: Unify reduction count for ets:select stdlib: Cuddle ets_SUITE for valgrind stdlib: Fix ets_SUITE:smp_select_delete erts: Tweak ets grow/shrink to keep up at contention erts: Fix ets_SUITE:memory erts: Suppress failed ETS memory checks erts: Reduce ets hash load factor erts: Enable a smaller first hash segment for ets erts: Redesign ets with separate segment tables erts: Remove unnecessary access of 'is_resizing' erts: Add ErtsSizeofMember macro erts: Add ErtsContainerStruct_ for array members
Diffstat (limited to 'erts/emulator/beam/erl_db.c')
-rw-r--r--erts/emulator/beam/erl_db.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_db.c b/erts/emulator/beam/erl_db.c
index 128a7b3865..485f68ca98 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 */