aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/global.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-02-10 23:32:12 +0100
committerBjörn-Egil Dahlberg <[email protected]>2015-03-12 19:15:24 +0100
commit6cc099bf98f384de1de3c0d8542c83db43fb5cec (patch)
tree15f19f1e96bcc6b2c805d9ad186cf370e3dfda03 /erts/emulator/beam/global.h
parent442c9b4d11a62c55b46ffb25f27b5ec5fb3adda7 (diff)
downloadotp-6cc099bf98f384de1de3c0d8542c83db43fb5cec.tar.gz
otp-6cc099bf98f384de1de3c0d8542c83db43fb5cec.tar.bz2
otp-6cc099bf98f384de1de3c0d8542c83db43fb5cec.zip
erts: Make hashmap compare non-recursive
Diffstat (limited to 'erts/emulator/beam/global.h')
-rw-r--r--erts/emulator/beam/global.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h
index 7585705949..ad7e6fb89d 100644
--- a/erts/emulator/beam/global.h
+++ b/erts/emulator/beam/global.h
@@ -529,7 +529,7 @@ void erl_grow_wstack(ErtsWStack*, Uint need);
#define WSTK_CONCAT(a,b) a##b
#define WSTK_DEF_STACK(s) WSTK_CONCAT(s,_default_wstack)
-#define DECLARE_WSTACK(s) \
+#define WSTACK_DECLARE(s) \
UWord WSTK_DEF_STACK(s)[DEF_WSTACK_SIZE]; \
ErtsWStack s = { \
WSTK_DEF_STACK(s), /* wstart */ \
@@ -538,6 +538,7 @@ void erl_grow_wstack(ErtsWStack*, Uint need);
WSTK_DEF_STACK(s), /* wdflt */ \
ERTS_ALC_T_ESTACK /* alloc_type */ \
}
+#define DECLARE_WSTACK WSTACK_DECLARE
#define WSTACK_CHANGE_ALLOCATOR(s,t) \
do { \
@@ -548,12 +549,13 @@ do { \
s.alloc_type = (t); \
} while (0)
-#define DESTROY_WSTACK(s) \
+#define WSTACK_DESTROY(s) \
do { \
if (s.wstart != WSTK_DEF_STACK(s)) { \
erts_free(s.alloc_type, s.wstart); \
} \
} while(0)
+#define DESTROY_WSTACK WSTACK_DESTROY
#define WSTACK_DEBUG(s) \
do { \
@@ -686,7 +688,8 @@ do { \
#define WSTACK_ISEMPTY(s) (s.wsp == s.wstart)
#define WSTACK_POP(s) ((ASSERT(s.wsp > s.wstart)),*(--s.wsp))
-
+#define WSTACK_ROLLBACK(s, count) (ASSERT(WSTACK_COUNT(s) >= (count)), \
+ s.wsp = s.wstart + (count))
/* PSTACK - Stack of any type.
* Usage: