aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/global.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2014-08-19 16:40:52 +0200
committerSverker Eriksson <[email protected]>2014-08-29 16:19:44 +0200
commitc1676f09ea1176116b503de88604816a2da36ac5 (patch)
tree82fc19510dcc444557646684f15d93bb83736707 /erts/emulator/beam/global.h
parentfb25e93d290138251d0305bd2698ad29575c661c (diff)
downloadotp-c1676f09ea1176116b503de88604816a2da36ac5.tar.gz
otp-c1676f09ea1176116b503de88604816a2da36ac5.tar.bz2
otp-c1676f09ea1176116b503de88604816a2da36ac5.zip
erts: Yield in term_to_binary when encoding big maps
Diffstat (limited to 'erts/emulator/beam/global.h')
-rw-r--r--erts/emulator/beam/global.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h
index 891046a8b5..02b8f399b5 100644
--- a/erts/emulator/beam/global.h
+++ b/erts/emulator/beam/global.h
@@ -597,6 +597,28 @@ do { \
*s.wsp++ = (z); \
} while(0)
+#define WSTACK_PUSH4(s, A1, A2, A3, A4) \
+do { \
+ if (s.wsp > s.wend - 4) { \
+ erl_grow_wstack(&s, WSTK_DEF_STACK(s)); \
+ } \
+ *s.wsp++ = (A1); \
+ *s.wsp++ = (A2); \
+ *s.wsp++ = (A3); \
+ *s.wsp++ = (A4); \
+} while(0)
+
+#define WSTACK_PUSH5(s, A1, A2, A3, A4, A5) \
+do { \
+ if (s.wsp > s.wend - 5) { \
+ erl_grow_wstack(&s, WSTK_DEF_STACK(s)); \
+ } \
+ *s.wsp++ = (A1); \
+ *s.wsp++ = (A2); \
+ *s.wsp++ = (A3); \
+ *s.wsp++ = (A4); \
+ *s.wsp++ = (A5); \
+} while(0)
#define WSTACK_COUNT(s) (s.wsp - s.wstart)
#define WSTACK_ISEMPTY(s) (s.wsp == s.wstart)
#define WSTACK_POP(s) (*(--s.wsp))