From 8fbe76d64e7d55eb41943484602b928658313a65 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 11 Mar 2014 12:23:06 +0100 Subject: erts: Document external format for maps (MAP_EXT) --- erts/doc/src/erl_ext_dist.xml | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'erts/doc/src') diff --git a/erts/doc/src/erl_ext_dist.xml b/erts/doc/src/erl_ext_dist.xml index f91ed78122..9a53f3f829 100644 --- a/erts/doc/src/erl_ext_dist.xml +++ b/erts/doc/src/erl_ext_dist.xml @@ -5,7 +5,7 @@
2007 - 2013 + 2014 Ericsson AB, All Rights Reserved @@ -572,6 +572,36 @@

+
+ + MAP_EXT + + + + 1 + 4 + N + M + + + 116 + Arity + Keys + Values + +
+

+ MAP_EXT encodes a map. The Arity field is an unsigned + 4 byte integer in big endian format that determines the number of + key-value pairs in the map. All key terms follow in the Keys + section and then all value terms in the Values section. Keys + and values are paired according to order; first key with first value + and so on. Duplicate keys are not allowed within the same + map. +

+

Since: OTP 17.0

+
+
NIL_EXT -- cgit v1.2.3 From c543d5bff7fb23c3f44cc4817c0654117de78919 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 12 Mar 2014 20:11:10 +0100 Subject: erts: Change external format for maps to be: 116,Arity, K1,V1,K2,V2,...,Kn,Vn instead of: 116,Arity, K1,K2,...,Kn, V1,V2,....,Vn We think this will be better for future internal map structures like HAMT. Would be bad if we need to iterate twice over HAMT in term_to_binary, one for keys and one for values. --- erts/doc/src/erl_ext_dist.xml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'erts/doc/src') diff --git a/erts/doc/src/erl_ext_dist.xml b/erts/doc/src/erl_ext_dist.xml index 9a53f3f829..fa083db4c7 100644 --- a/erts/doc/src/erl_ext_dist.xml +++ b/erts/doc/src/erl_ext_dist.xml @@ -581,23 +581,20 @@ 1 4 N - M 116 Arity - Keys - Values + Pairs

MAP_EXT encodes a map. The Arity field is an unsigned 4 byte integer in big endian format that determines the number of - key-value pairs in the map. All key terms follow in the Keys - section and then all value terms in the Values section. Keys - and values are paired according to order; first key with first value - and so on. Duplicate keys are not allowed within the same - map. + key-value pairs in the map. Key and value pairs (Ki => Vi) + are encoded in the Pairs section in the following order: + K1, V1, K2, V2,..., Kn, Vn. + Duplicate keys are not allowed within the same map.

Since: OTP 17.0

-- cgit v1.2.3