Skip to content

Optimisation pass: limit width of sub-expression exploration#1059

Open
AltGr wants to merge 1 commit into
masterfrom
optiloop
Open

Optimisation pass: limit width of sub-expression exploration#1059
AltGr wants to merge 1 commit into
masterfrom
optiloop

Conversation

@AltGr

@AltGr AltGr commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

This is a quick-fix, but should avoid some explosions for now.

This is a quick-fix, but should avoid some explosions for now.
let vars, body = Bindlib.unmbind binder in
let rec vars_count (e : (('a, 'b) dcalc_lcalc, 'm) gexpr) : int array =
let credit = ref 14 in
(* Raises [Exit] on either var used twice, or credit exhausted *)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A high-level comment linking the credit to the size of sub-expressions would be perfect :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants