summaryrefslogtreecommitdiffhomepage
path: root/src/main.c
diff options
context:
space:
mode:
authorSean Kurtz <seankurtz75@gmail.com>2026-11-25 17:50:59 -0600
committerSean Kurtz <seankurtz75@gmail.com>2026-11-25 17:50:59 -0600
commit4eba9006c8f36164070690e34e9be10f94d39221 (patch)
treefe95f9118c77b38fc06c5ebcc49cd7e1d2dda2cc /src/main.c
parent0ebef9da03f1952e8d0189a48cd7b946a7369f4f (diff)
downloadzash-perf/fork-fastpath.tar.gz
perf: temporary fork-path ablation switchesperf/fork-fastpath
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 43026f6..7821ec3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -280,7 +280,9 @@ void exit_shell(int status) {
exiting = true;
exitstatus = status;
jmploc jl;
- if (setjmp(jl.buf) == 0) {
+ if (perf_ablate() & 16) {
+ /* experiment: skip the EXIT trap */
+ } else if (setjmp(jl.buf) == 0) {
exc_handler = &jl;
trap_run_exit();
} else if (exc_code == EXC_EXIT) {
@@ -295,7 +297,8 @@ void exit_shell(int status) {
if (!in_subshell && var_get("ZASH_PROCSTAT"))
out_printf(&out2, "zash: spawns=%ld forks=%ld\n", stat_spawns,
stat_forks);
- flush_all();
+ if (!(perf_ablate() & 32))
+ flush_all();
_exit(code);
}