summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/bif.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <bjorn@erlang.org>2020-02-18 06:26:33 +0100
committerBjörn Gustavsson <bjorn@erlang.org>2020-02-21 10:16:21 +0100
commit38df9be8e5fabf9de15524fe176696b7e3bbeac7 (patch)
tree04d854ba115edc3cd9c0adf424d2f3b9aec90353 /erts/emulator/beam/bif.c
parent468b9a20b7f9d9585df750987b52e9e8f942f0ff (diff)
downloaderlang-38df9be8e5fabf9de15524fe176696b7e3bbeac7.tar.gz
Don't keep stacktraces forever
The `erlang:get_stacktrace/0` BIF retrieves the stacktrace from the previous error in the process. The problem is that the very existence of `erlang:get_stacktrace/0` means that the stacktrace and potentially function arguments must be kept indefinitely. Therefore, in OTP 21, the `erlang:get_stacktrace/0` BIF was deprecated and the syntax of try/catch extended to allow matching out the stacktrace directly. This commit changes `erlang:get_stacktrace/0` for OTP 23 to always return an empty list (`[]`) and eliminates the need to keep the stacktrace forever. `erlang:get_stacktrace/0` is scheduled for removal in OTP 24.
Diffstat (limited to 'erts/emulator/beam/bif.c')
-rw-r--r--erts/emulator/beam/bif.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c
index 220b24128c..c472c4fadc 100644
--- a/erts/emulator/beam/bif.c
+++ b/erts/emulator/beam/bif.c
@@ -1006,8 +1006,7 @@ BIF_RETTYPE hibernate_3(BIF_ALIST_3)
BIF_RETTYPE get_stacktrace_0(BIF_ALIST_0)
{
- Eterm t = build_stacktrace(BIF_P, BIF_P->ftrace);
- BIF_RET(t);
+ BIF_RET(NIL);
}
/**********************************************************************/