aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2020-10-22 18:45:41 +0200
committerPierre-Marie Pédrot2020-11-03 15:11:37 +0100
commita53eeffbbb573dd8c354d5e68ac19dea5f511f79 (patch)
tree6b9dadf288b82a8434bf166d360eff49c4e136c8
parentdfdecf24210ee287d554cf4296bd0ccfffe310d8 (diff)
Add a fast path in CClosure stack zipping.
No need to zip the stack if the machine has made no progress.
-rw-r--r--kernel/cClosure.ml7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/cClosure.ml b/kernel/cClosure.ml
index 952237ab99..174125fc57 100644
--- a/kernel/cClosure.ml
+++ b/kernel/cClosure.ml
@@ -1535,7 +1535,12 @@ let whd_stack infos tab m stk = match Mark.red_state m.mark with
knh infos m stk
| Red | Cstr ->
let k = kni infos tab m stk in
- let () = if infos.i_cache.i_share then ignore (fapp_stack k) in (* to unlock Zupdates! *)
+ let () =
+ if infos.i_cache.i_share then
+ (* to unlock Zupdates! *)
+ let (m', stk') = k in
+ if not (m == m' && stk == stk') then ignore (zip m' stk')
+ in
k
let create_clos_infos ?univs ?(evars=fun _ -> None) flgs env =