lang: gapi, unification: Shutdown unification quickly when asked

This is a bit of a hack until we improve the GAPI a bit, but will let us
shut down type unification a bit faster if we want to interrupt a long
running operation. Hopefully our future algorthmic performance
improvements will obliviate the need for this to be a common issue.
This commit is contained in:
James Shubin
2024-03-22 03:21:15 -04:00
parent c4b14ac40d
commit 89784e86bd
3 changed files with 19 additions and 1 deletions

View File

@@ -771,6 +771,13 @@ Loop:
}
// is there another EqualityWrapFuncInvariant with the same Expr1 pointer?
for _, fn := range fnInvariants {
// XXX: I think we're busy in this loop a lot.
select {
case <-ctx.Done():
return nil, ctx.Err()
default:
// pass
}
// is this fn.Expr1 related by equivalency graph to eq.Expr1 ?
if (eq.Expr1 != fn.Expr1) && !inEquiv(fn.Expr1) {
if obj.Debug {