diff options
author | Rickard Green <[email protected]> | 2013-10-30 17:29:18 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2013-11-18 20:12:36 +0100 |
commit | c6cb0293ba33e1671f8ed670d5add082e5ee674a (patch) | |
tree | a00e3500442c0a175fbc027b61b437b103b8b8fb /erts/emulator/beam/erl_bif_info.c | |
parent | 406fd5c773b5ae73dbfc6b305a502ffbe236a9bb (diff) | |
download | otp-c6cb0293ba33e1671f8ed670d5add082e5ee674a.tar.gz otp-c6cb0293ba33e1671f8ed670d5add082e5ee674a.tar.bz2 otp-c6cb0293ba33e1671f8ed670d5add082e5ee674a.zip |
Functionality for disabling garbage collection
Being able to disable garbage collection over context
switches vastly simplifies implementation of yielding
native code that builds large or complex data structures
on the heap. This since the heap can be left in an
inconsistent state over the context switch.
Diffstat (limited to 'erts/emulator/beam/erl_bif_info.c')
-rwxr-xr-x | erts/emulator/beam/erl_bif_info.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c index 673dfc658c..f5893f9291 100755 --- a/erts/emulator/beam/erl_bif_info.c +++ b/erts/emulator/beam/erl_bif_info.c @@ -3593,6 +3593,19 @@ BIF_RETTYPE erts_debug_set_internal_state_2(BIF_ALIST_2) BIF_RET(am_true); } } + else if (ERTS_IS_ATOM_STR("gc_state", BIF_ARG_1)) { + /* Used by process_SUITE (emulator) */ + int res, enable; + + switch (BIF_ARG_2) { + case am_true: enable = 1; break; + case am_false: enable = 0; break; + default: BIF_ERROR(BIF_P, BADARG); break; + } + + res = erts_set_gc_state(BIF_P, enable); + BIF_RET(res ? am_true : am_false); + } else if (ERTS_IS_ATOM_STR("send_fake_exit_signal", BIF_ARG_1)) { /* Used by signal_SUITE (emulator) */ |