diff options
author | Sverker Eriksson <[email protected]> | 2015-03-10 19:03:19 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2015-03-12 19:15:33 +0100 |
commit | 27e57aa05354b743b735a41716c0e3af18f2843e (patch) | |
tree | e4fd8e92ce0af4e758864d800abbadb4f5c4bf3e /erts/emulator/beam/external.c | |
parent | 693b99697950661cea7dbf2b504a4cf9a12a0880 (diff) | |
download | otp-27e57aa05354b743b735a41716c0e3af18f2843e.tar.gz otp-27e57aa05354b743b735a41716c0e3af18f2843e.tar.bz2 otp-27e57aa05354b743b735a41716c0e3af18f2843e.zip |
erts: Refactor maps naming convention
flatmap: Small map
hashmap: Large map
map: flatmap or hashmap
Diffstat (limited to 'erts/emulator/beam/external.c')
-rw-r--r-- | erts/emulator/beam/external.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/erts/emulator/beam/external.c b/erts/emulator/beam/external.c index bd9ad65086..65b4ae5412 100644 --- a/erts/emulator/beam/external.c +++ b/erts/emulator/beam/external.c @@ -2605,15 +2605,15 @@ enc_term_int(TTBEncodeContext* ctx, ErtsAtomCacheMap *acmp, Eterm obj, byte* ep, case MAP_DEF: { - map_t *mp = (map_t*)map_val(obj); - Uint size = map_get_size(mp); + flatmap_t *mp = (flatmap_t*)flatmap_val(obj); + Uint size = flatmap_get_size(mp); *ep++ = MAP_EXT; put_int32(size, ep); ep += 4; if (size > 0) { - Eterm *kptr = map_get_keys(mp); - Eterm *vptr = map_get_values(mp); + Eterm *kptr = flatmap_get_keys(mp); + Eterm *vptr = flatmap_get_values(mp); WSTACK_PUSH4(s, (UWord)kptr, (UWord)vptr, ENC_MAP_PAIR, size); @@ -3599,14 +3599,14 @@ dec_term_atom_common: size = get_int32(ep); ep += 4; if (size <= MAP_SMALL_MAP_LIMIT) { - map_t *mp; + flatmap_t *mp; keys = make_tuple(hp); *hp++ = make_arityval(size); hp += size; kptr = hp - 1; - mp = (map_t*)hp; + mp = (flatmap_t*)hp; hp += MAP_HEADER_SIZE; hp += size; vptr = hp - 1; @@ -3625,7 +3625,7 @@ dec_term_atom_common: mp->size = size; mp->keys = keys; - *objp = make_map(mp); + *objp = make_flatmap(mp); for (n = size; n; n--) { *vptr = (Eterm) COMPRESS_POINTER(next); @@ -3891,7 +3891,7 @@ dec_term_atom_common: while (maps_list) { next = (Eterm *)(EXPAND_POINTER(*maps_list)); *maps_list = MAP_HEADER; - if (!erts_validate_and_sort_map((map_t*)maps_list)) + if (!erts_validate_and_sort_flatmap((flatmap_t*)maps_list)) goto error; maps_list = next; } @@ -4120,15 +4120,15 @@ encode_size_struct_int(TTBSizeContext* ctx, ErtsAtomCacheMap *acmp, Eterm obj, break; case MAP_DEF: { - map_t *mp = (map_t*)map_val(obj); - Uint size = map_get_size(mp); + flatmap_t *mp = (flatmap_t*)flatmap_val(obj); + Uint size = flatmap_get_size(mp); Uint i; Eterm *ptr; result += 1 + 4; /* tag + 4 bytes size */ /* push values first */ - ptr = map_get_values(mp); + ptr = flatmap_get_values(mp); i = size; while(i--) { if (is_list(*ptr)) { @@ -4142,7 +4142,7 @@ encode_size_struct_int(TTBSizeContext* ctx, ErtsAtomCacheMap *acmp, Eterm obj, ++ptr; } - ptr = map_get_keys(mp); + ptr = flatmap_get_keys(mp); i = size; while(i--) { if (is_list(*ptr)) { |