aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_gc.h
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-03-20 18:01:50 +0100
committerBjörn-Egil Dahlberg <[email protected]>2015-03-25 12:08:17 +0100
commitc157dce842bf78080c533472fcec74df01ed8fdb (patch)
treecc8db9c443261418e1abfc13cc21bb384f8e4ab9 /erts/emulator/beam/erl_gc.h
parent1f3869b308af19fb9cf471a12b8a1fdeab9da290 (diff)
downloadotp-c157dce842bf78080c533472fcec74df01ed8fdb.tar.gz
otp-c157dce842bf78080c533472fcec74df01ed8fdb.tar.bz2
otp-c157dce842bf78080c533472fcec74df01ed8fdb.zip
erts: Combine flat and hash maps under one unifying tag
Diffstat (limited to 'erts/emulator/beam/erl_gc.h')
-rw-r--r--erts/emulator/beam/erl_gc.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_gc.h b/erts/emulator/beam/erl_gc.h
index 8afcb060a1..bd6dcc9078 100644
--- a/erts/emulator/beam/erl_gc.h
+++ b/erts/emulator/beam/erl_gc.h
@@ -55,9 +55,10 @@ do { \
nelts = header_arity(HDR); \
switch ((HDR) & _HEADER_SUBTAG_MASK) { \
case SUB_BINARY_SUBTAG: nelts++; break; \
- case MAP_SUBTAG: nelts+=flatmap_get_size(PTR) + 1; break; \
- case HASHMAP_SUBTAG: nelts=hashmap_bitcount(MAP_HEADER_VAL(HDR)); \
- nelts += is_hashmap_header_head(HDR) ? 1 : 0; break; \
+ case MAP_SUBTAG: \
+ if (is_flatmap_header(HDR)) nelts+=flatmap_get_size(PTR) + 1; \
+ else nelts += hashmap_bitcount(MAP_HEADER_VAL(HDR)); \
+ break; \
case FUN_SUBTAG: nelts+=((ErlFunThing*)(PTR))->num_free+1; break; \
} \
gval = make_boxed(HTOP); \