aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/global.h
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2016-09-01 15:33:15 +0200
committerRickard Green <[email protected]>2016-09-01 15:33:15 +0200
commit0bbc77b13d97e061221078798ec7019819814597 (patch)
tree8da3ec4406591ab51386b899c95bf0b3ece614f2 /erts/emulator/beam/global.h
parent18d398f0908346dbf9f7e2c08f68759a05673d2f (diff)
parent068185ef518384c0141cc643820f3a2a103ff4c3 (diff)
downloadotp-0bbc77b13d97e061221078798ec7019819814597.tar.gz
otp-0bbc77b13d97e061221078798ec7019819814597.tar.bz2
otp-0bbc77b13d97e061221078798ec7019819814597.zip
Merge branch 'maint'
* maint: Fix reclaim of literal areas Conflicts: erts/emulator/beam/global.h
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 d7dd6371b7..1cafa48158 100644
--- a/erts/emulator/beam/global.h
+++ b/erts/emulator/beam/global.h
@@ -1016,7 +1016,10 @@ typedef struct ErtsLiteralArea_ {
#define ERTS_LITERAL_AREA_ALLOC_SIZE(N) \
(sizeof(ErtsLiteralArea) + sizeof(Eterm)*((N) - 1))
-extern ErtsLiteralArea *erts_copy_literal_area;
+extern erts_smp_atomic_t erts_copy_literal_area__;
+#define ERTS_COPY_LITERAL_AREA() \
+ ((ErtsLiteralArea *) erts_smp_atomic_read_nob(&erts_copy_literal_area__))
+
#ifdef ERTS_NEW_PURGE_STRATEGY
extern Process *erts_literal_area_collector;
#endif
@@ -1107,7 +1110,7 @@ typedef struct {
#define INITIALIZE_SHCOPY(info) \
do { \
- ErtsLiteralArea *larea__ = erts_copy_literal_area; \
+ ErtsLiteralArea *larea__ = ERTS_COPY_LITERAL_AREA(); \
info.queue_start = info.queue_default; \
info.bitstore_start = info.bitstore_default; \
info.shtable_start = info.shtable_default; \
@@ -1143,7 +1146,7 @@ typedef struct {
#define INITIALIZE_LITERAL_PURGE_AREA(Area) \
do { \
- ErtsLiteralArea *larea__ = erts_copy_literal_area; \
+ ErtsLiteralArea *larea__ = ERTS_COPY_LITERAL_AREA(); \
if (larea__) { \
(Area).lit_purge_ptr = &larea__->start[0]; \
(Area).lit_purge_sz = larea__->end - (Area).lit_purge_ptr; \