diff options
author | Sverker Eriksson <[email protected]> | 2012-01-18 17:07:35 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2012-02-21 12:22:57 +0100 |
commit | 272a61ce4cfa7e92a037fbf71bc79ec0456f8b2b (patch) | |
tree | 7aa337eccd647b91e8a91bc1dce8c1be29df3631 /erts/emulator/beam/erl_bif_chksum.c | |
parent | 166032bddf9a14f3ea6252724532039a1113612d (diff) | |
download | otp-272a61ce4cfa7e92a037fbf71bc79ec0456f8b2b.tar.gz otp-272a61ce4cfa7e92a037fbf71bc79ec0456f8b2b.tar.bz2 otp-272a61ce4cfa7e92a037fbf71bc79ec0456f8b2b.zip |
erts: Refactor new helper function erts_init_trap_export
Diffstat (limited to 'erts/emulator/beam/erl_bif_chksum.c')
-rw-r--r-- | erts/emulator/beam/erl_bif_chksum.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/erts/emulator/beam/erl_bif_chksum.c b/erts/emulator/beam/erl_bif_chksum.c index 06b7ffdf32..ff5ce3cc7a 100644 --- a/erts/emulator/beam/erl_bif_chksum.c +++ b/erts/emulator/beam/erl_bif_chksum.c @@ -42,16 +42,9 @@ static Export chksum_md5_2_exp; void erts_init_bif_chksum(void) { /* Non visual BIF to trap to. */ - memset(&chksum_md5_2_exp, 0, sizeof(Export)); - chksum_md5_2_exp.address = - &chksum_md5_2_exp.code[3]; - chksum_md5_2_exp.code[0] = am_erlang; - chksum_md5_2_exp.code[1] = am_atom_put("md5_trap",8); - chksum_md5_2_exp.code[2] = 2; - chksum_md5_2_exp.code[3] = - (BeamInstr) em_apply_bif; - chksum_md5_2_exp.code[4] = - (BeamInstr) &md5_2; + erts_init_trap_export(&chksum_md5_2_exp, + am_erlang, am_atom_put("md5_trap",8), 2, + &md5_2); } |