aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/sys.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2010-11-02 18:08:04 +0100
committerSverker Eriksson <[email protected]>2010-11-22 15:54:48 +0100
commit454335cd043561cc9fe874bc325c152a0727328b (patch)
treec12359d358fd8664bb5eb3b22cac80c5a8880e77 /erts/emulator/beam/sys.h
parent7ceec2cef3643f2c2f63ae169f74da660803435b (diff)
downloadotp-454335cd043561cc9fe874bc325c152a0727328b.tar.gz
otp-454335cd043561cc9fe874bc325c152a0727328b.tar.bz2
otp-454335cd043561cc9fe874bc325c152a0727328b.zip
ETS 'compressed' option.
The compressed format is using a slighty modified variant of the extern format (term_to_binary). To not worsen key lookup's too much, the top tuple itself and the key element are not compressed. Table objects with only immediate non-key elements will therefor not gain anything (but actually consume one extra word for "alloc_size").
Diffstat (limited to 'erts/emulator/beam/sys.h')
-rw-r--r--erts/emulator/beam/sys.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h
index 93203a08a9..0d15272aa8 100644
--- a/erts/emulator/beam/sys.h
+++ b/erts/emulator/beam/sys.h
@@ -1166,6 +1166,15 @@ void* sys_calloc2(Uint, Uint);
((char*)(s))[3] = (char)(i) & 0xff;} \
while (0)
+#define get_int24(s) ((((unsigned char*) (s))[0] << 16) | \
+ (((unsigned char*) (s))[1] << 8) | \
+ (((unsigned char*) (s))[2]))
+
+#define put_int24(i, s) do {((char*)(s))[0] = (char)((i) >> 16) & 0xff; \
+ ((char*)(s))[1] = (char)((i) >> 8) & 0xff; \
+ ((char*)(s))[2] = (char)(i) & 0xff;} \
+ while (0)
+
#define get_int16(s) ((((unsigned char*) (s))[0] << 8) | \
(((unsigned char*) (s))[1]))
@@ -1179,6 +1188,7 @@ void* sys_calloc2(Uint, Uint);
#define put_int8(i, s) do {((unsigned char*)(s))[0] = (i) & 0xff;} while (0)
+
/*
* Use DEBUGF as you would use printf, but use double parentheses:
*