diff options
author | Sverker Eriksson <[email protected]> | 2015-10-05 16:13:37 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2015-11-12 15:25:47 +0100 |
commit | 7858ca939f8bf2db918396616fee13364d150a1e (patch) | |
tree | dc46cae9aa47da95edf98f1dc3510a0449787024 /erts/emulator/beam/beam_load.h | |
parent | b9caedf093d0ccf268562656e28cdda6a02631cb (diff) | |
download | otp-7858ca939f8bf2db918396616fee13364d150a1e.tar.gz otp-7858ca939f8bf2db918396616fee13364d150a1e.tar.bz2 otp-7858ca939f8bf2db918396616fee13364d150a1e.zip |
erts: Refactor line table in loaded beam code
to use real C struct with correct types
Diffstat (limited to 'erts/emulator/beam/beam_load.h')
-rw-r--r-- | erts/emulator/beam/beam_load.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/erts/emulator/beam/beam_load.h b/erts/emulator/beam/beam_load.h index c86ac65521..22ab71c868 100644 --- a/erts/emulator/beam/beam_load.h +++ b/erts/emulator/beam/beam_load.h @@ -61,6 +61,8 @@ extern BeamInstr* em_call_nif; /* Total code size in bytes */ extern Uint erts_total_code_size; +typedef struct BeamCodeLineTab_ BeamCodeLineTab; + /* * Header of code chunks which contains additional information * about the loaded module. @@ -100,7 +102,7 @@ typedef struct beam_code_header { /* * Pointer to the line table (or NULL if none). */ - Eterm* line_table; + BeamCodeLineTab* line_table; /* * Pointer to the module MD5 sum (16 bytes) @@ -124,11 +126,15 @@ int erts_is_module_native(BeamCodeHeader* code); /* * Layout of the line table. */ - -#define MI_LINE_FNAME_PTR 0 -#define MI_LINE_LOC_TAB 1 -#define MI_LINE_LOC_SIZE 2 -#define MI_LINE_FUNC_TAB 3 +struct BeamCodeLineTab_ { + Eterm* fname_ptr; + int loc_size; + union { + Uint16* p2; + Uint32* p4; + }loc_tab; + const BeamInstr** func_tab[1]; +}; #define LINE_INVALID_LOCATION (0) |