aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_load.h
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2016-07-20 17:30:39 +0200
committerRickard Green <[email protected]>2016-08-08 17:35:03 +0200
commitaeb645a709b73e1bda0281f87dda2af3ce92dfe7 (patch)
treea1dfdf628459e1d999c2671feb02324b543453e2 /erts/emulator/beam/beam_load.h
parentb490fb8664ec6e5ceaadc1c74350dc666f5406d2 (diff)
downloadotp-aeb645a709b73e1bda0281f87dda2af3ce92dfe7.tar.gz
otp-aeb645a709b73e1bda0281f87dda2af3ce92dfe7.tar.bz2
otp-aeb645a709b73e1bda0281f87dda2af3ce92dfe7.zip
Separate literal area from code
Diffstat (limited to 'erts/emulator/beam/beam_load.h')
-rw-r--r--erts/emulator/beam/beam_load.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/erts/emulator/beam/beam_load.h b/erts/emulator/beam/beam_load.h
index fd2dd97fee..336f097f0f 100644
--- a/erts/emulator/beam/beam_load.h
+++ b/erts/emulator/beam/beam_load.h
@@ -60,6 +60,15 @@ extern BeamInstr* em_call_nif;
/* Total code size in bytes */
extern Uint erts_total_code_size;
+typedef struct {
+ struct erl_off_heap_header *off_heap;
+ Eterm *end;
+ Eterm start[1]; /* beginning of area */
+} ErtsLiteralArea;
+
+#define ERTS_LITERAL_AREA_ALLOC_SIZE(N) \
+ (sizeof(ErtsLiteralArea) + sizeof(Eterm)*((N) - 1))
+
typedef struct BeamCodeLineTab_ BeamCodeLineTab;
/*
@@ -89,9 +98,7 @@ typedef struct beam_code_header {
/*
* Literal area (constant pool).
*/
- Eterm* literals_start;
- Eterm* literals_end;
- struct erl_off_heap_header* literals_off_heap;
+ ErtsLiteralArea *literal_area;
/*
* Pointer to the on_load function (or NULL if none).
@@ -120,6 +127,7 @@ typedef struct beam_code_header {
}BeamCodeHeader;
+void erts_release_literal_area(ErtsLiteralArea* literal_area);
int erts_is_module_native(BeamCodeHeader* code);
/*