summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/erl_unicode.c
diff options
context:
space:
mode:
authorLukas Larsson <lukas@erlang.org>2020-07-08 17:18:53 +0200
committerLukas Larsson <lukas@erlang.org>2020-09-21 16:40:30 +0200
commit2c251b21dc53b2105be33b0237986880957e3ed3 (patch)
tree3a89c950e35783e888543fc66f7745766eaf5351 /erts/emulator/beam/erl_unicode.c
parent8c3b8f05798ba6feca3804a6b54c328e75db89d7 (diff)
downloaderlang-2c251b21dc53b2105be33b0237986880957e3ed3.tar.gz
erts: Refactor bif exports to be allocated at start-time
This is needed as BeamAsm needs the export entries to be executable, which means that we need to allocate them. Co-authored-by: John Högberg <john@erlang.org> Co-authored-by: Dan Gudmundsson <dgud@erlang.org>
Diffstat (limited to 'erts/emulator/beam/erl_unicode.c')
-rw-r--r--erts/emulator/beam/erl_unicode.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/erts/emulator/beam/erl_unicode.c b/erts/emulator/beam/erl_unicode.c
index aa25cd36ed..43163cebf6 100644
--- a/erts/emulator/beam/erl_unicode.c
+++ b/erts/emulator/beam/erl_unicode.c
@@ -64,12 +64,12 @@ static BIF_RETTYPE characters_to_list_trap_2(BIF_ALIST_3);
static BIF_RETTYPE characters_to_list_trap_3(BIF_ALIST_3);
static BIF_RETTYPE characters_to_list_trap_4(BIF_ALIST_1);
-static Export characters_to_utf8_trap_exp;
-static Export characters_to_list_trap_1_exp;
-static Export characters_to_list_trap_2_exp;
+static Export *characters_to_utf8_trap_exp;
+static Export *characters_to_list_trap_1_exp;
+static Export *characters_to_list_trap_2_exp;
-static Export characters_to_list_trap_3_exp;
-static Export characters_to_list_trap_4_exp;
+static Export *characters_to_list_trap_3_exp;
+static Export *characters_to_list_trap_4_exp;
static Export *c_to_b_int_trap_exportp = NULL;
static Export *c_to_l_int_trap_exportp = NULL;
@@ -873,7 +873,7 @@ static BIF_RETTYPE build_utf8_return(Process *p,Eterm bin,Uint pos,
rest_term = CONS(hp,rest_bin,rest_term);
}
BUMP_ALL_REDS(p);
- BIF_TRAP3(&characters_to_utf8_trap_exp, p, bin, rest_term, latin1);
+ BIF_TRAP3(characters_to_utf8_trap_exp, p, bin, rest_term, latin1);
} else { /* Success */
/*hp = HAlloc(p,5);
ret = TUPLE4(hp,mk_utf8_result_bin(p,bin),rest_term,make_small(pos),make_small(err));*/
@@ -1090,7 +1090,7 @@ static BIF_RETTYPE build_list_return(Process *p, byte *bytes, Uint pos, Uint cha
rc.num_bytes_to_process = pos;
rc.num_resulting_chars = characters;
rc.state = ERTS_UTF8_OK; /* not used */
- BIF_TRAP3(&characters_to_list_trap_1_exp, p, make_magic_bin_for_restart(p,&rc),
+ BIF_TRAP3(characters_to_list_trap_1_exp, p, make_magic_bin_for_restart(p,&rc),
rest_term, latin1);
} else { /* Success */
BIF_RET(finalize_list_to_list(p, bytes, NIL, 0U, pos, characters, ERTS_UTF8_OK, left, NIL));
@@ -1680,7 +1680,7 @@ static BIF_RETTYPE finalize_list_to_list(Process *p,
rc.state = state;
rc.bytes = bytes;
BUMP_ALL_REDS(p);
- BIF_TRAP3(&characters_to_list_trap_2_exp, p,
+ BIF_TRAP3(characters_to_list_trap_2_exp, p,
make_magic_bin_for_restart(p, &rc), rest, converted);
}
}
@@ -1789,7 +1789,7 @@ static BIF_RETTYPE do_bif_utf8_to_list(Process *p,
Eterm enumchar = erts_make_integer(num_resulting_chars,p);
erts_free_aligned_binary_bytes(temp_alloc);
BUMP_ALL_REDS(p);
- BIF_TRAP3(&characters_to_list_trap_3_exp, p, orig_bin, epos,
+ BIF_TRAP3(characters_to_list_trap_3_exp, p, orig_bin, epos,
enumchar);
}
}
@@ -1825,7 +1825,7 @@ static BIF_RETTYPE do_bif_utf8_to_list(Process *p,
converted);
BUMP_ALL_REDS(p);
erts_free_aligned_binary_bytes(temp_alloc);
- BIF_TRAP1(&characters_to_list_trap_4_exp,p,traptuple);
+ BIF_TRAP1(characters_to_list_trap_4_exp,p,traptuple);
}
}