aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_map.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-03-10 18:07:11 +0100
committerBjörn-Egil Dahlberg <[email protected]>2015-03-12 19:15:33 +0100
commit7478569d0a7d619d600816f3a75e56922d8ed428 (patch)
tree7c2a3783fd87c3b720464f748cf57a25d07ade6d /erts/emulator/beam/erl_map.h
parent01e843722aa39b3411d349c6fbea80ad87a6e9ef (diff)
downloadotp-7478569d0a7d619d600816f3a75e56922d8ed428.tar.gz
otp-7478569d0a7d619d600816f3a75e56922d8ed428.tar.bz2
otp-7478569d0a7d619d600816f3a75e56922d8ed428.zip
erts: Tweak over estimation of hashmap size for binary_to_term
Strategy: Calculate an over estimation of heap size that will give such a low probability for overflow, that "it will not happen". Scary assumption 1: Uniformly distributed hash values. Scary assumption 2: Tree size is normally distributed (right?)
Diffstat (limited to 'erts/emulator/beam/erl_map.h')
-rw-r--r--erts/emulator/beam/erl_map.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_map.h b/erts/emulator/beam/erl_map.h
index 39d98b9e03..659295184d 100644
--- a/erts/emulator/beam/erl_map.h
+++ b/erts/emulator/beam/erl_map.h
@@ -99,6 +99,7 @@ Eterm erts_hashmap_insert_up(Eterm *hp, Eterm key, Eterm value,
Uint *upsz, struct ErtsEStack_ *sp);
int erts_validate_and_sort_map(map_t* map);
+Uint hashmap_over_estimated_heap_size(Uint n);
void hashmap_iterator_init(struct ErtsWStack_* s, Eterm node);
Eterm* hashmap_iterator_next(struct ErtsWStack_* s);
int hashmap_key_hash_cmp(Eterm* ap, Eterm* bp);