diff options
author | Rickard Green <[email protected]> | 2015-11-12 16:15:05 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2015-11-12 16:15:05 +0100 |
commit | 4f815fab536a3ec1839c2590b8f4f169a27fccac (patch) | |
tree | 49d1539f21954ffcdcb2523de1319d2d3efbf0ef /erts/emulator/beam/erl_term.c | |
parent | ef72a791f4dc9a1816ac8ff95a612409b86de818 (diff) | |
parent | 3ac08f9b668613a4292436979eacc61863c2ab94 (diff) | |
download | otp-4f815fab536a3ec1839c2590b8f4f169a27fccac.tar.gz otp-4f815fab536a3ec1839c2590b8f4f169a27fccac.tar.bz2 otp-4f815fab536a3ec1839c2590b8f4f169a27fccac.zip |
Merge branch 'rickard/ohmq/OTP-13047'
* rickard/ohmq/OTP-13047:
Fragmented young heap generation and off_heap_message_queue option
Refactor GC
Introduce literal tag
Conflicts:
erts/doc/src/erlang.xml
erts/emulator/beam/erl_gc.c
Diffstat (limited to 'erts/emulator/beam/erl_term.c')
-rw-r--r-- | erts/emulator/beam/erl_term.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_term.c b/erts/emulator/beam/erl_term.c index ed302fa2fa..e31d3a951d 100644 --- a/erts/emulator/beam/erl_term.c +++ b/erts/emulator/beam/erl_term.c @@ -28,6 +28,37 @@ #include <stdlib.h> #include <stdio.h> +void +erts_set_literal_tag(Eterm *term, Eterm *hp_start, Eterm hsz) +{ +#ifdef TAG_LITERAL_PTR + Eterm *hp_end, *hp; + + hp_end = hp_start + hsz; + hp = hp_start; + + while (hp < hp_end) { + switch (primary_tag(*hp)) { + case TAG_PRIMARY_BOXED: + case TAG_PRIMARY_LIST: + *hp |= TAG_LITERAL_PTR; + break; + case TAG_PRIMARY_HEADER: + if (header_is_thing(*hp)) { + hp += thing_arityval(*hp); + } + break; + default: + break; + } + + hp++; + } + if (is_boxed(*term) || is_list(*term)) + *term |= TAG_LITERAL_PTR; +#endif +} + __decl_noreturn static void __noreturn et_abort(const char *expr, const char *file, unsigned line) { |