aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_rbtree.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-02-15 19:19:02 +0100
committerSverker Eriksson <[email protected]>2017-03-22 15:27:16 +0100
commit8d98992b9fa3059554c6cd5ff45ee3b47805fa1c (patch)
tree95aefb70e68d6667d2a3b3d96ec53a0f5f0f1ee2 /erts/emulator/beam/erl_rbtree.h
parent8b2a0f9940ffde4533d029a87ee30e290552db61 (diff)
downloadotp-8d98992b9fa3059554c6cd5ff45ee3b47805fa1c.tar.gz
otp-8d98992b9fa3059554c6cd5ff45ee3b47805fa1c.tar.bz2
otp-8d98992b9fa3059554c6cd5ff45ee3b47805fa1c.zip
erts: Add ERTS_RBT_YIELD_STAT_INIT to erl_rbtree
for dynamic initialization of yield state.
Diffstat (limited to 'erts/emulator/beam/erl_rbtree.h')
-rw-r--r--erts/emulator/beam/erl_rbtree.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_rbtree.h b/erts/emulator/beam/erl_rbtree.h
index 5fefaea978..a10b1b1081 100644
--- a/erts/emulator/beam/erl_rbtree.h
+++ b/erts/emulator/beam/erl_rbtree.h
@@ -105,7 +105,10 @@
* <ERTS_RBT_PREFIX>_rbt_yield_state_t.
*
* The yield state should be statically initialized by
- * ERTS_RBT_YIELD_STAT_INITER.
+ * ERTS_RBT_YIELD_STAT_INITER
+ *
+ * or dynamically initialized with
+ * ERTS_RBT_YIELD_STAT_INIT(<ERTS_RBT_PREFIX>_rbt_yield_state_t *ystate)
*
*
* The following API functions are implemented if corresponding
@@ -422,6 +425,13 @@
#ifndef ERTS_RBT_YIELD_STAT_INITER
# define ERTS_RBT_YIELD_STAT_INITER {NULL, 0}
#endif
+#ifndef ERTS_RBT_YIELD_STAT_INIT
+# define ERTS_RBT_YIELD_STAT_INIT(YS) \
+ do { \
+ (YS)->x = NULL; \
+ (YS)->up = 0; \
+ } while (0)
+#endif
#define ERTS_RBT_CONCAT_MACRO_VALUES___(X, Y) \
X ## Y