-
Notifications
You must be signed in to change notification settings - Fork 43
fix Context leak
#2048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix Context leak
#2048
Conversation
|
currently erroring on |
|
a stacktrace with debug symbols shows new info: it seems like the error triggers on the finalizer of UPDATE: this has been fixed by adding a fake dependency between |
| end | ||
|
|
||
| # use types from API to avoid interfering with GC | ||
| const __context_gc_module = Dict{API.MlirContext, Set{API.MlirModule}}() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[JuliaFormatter] reported by reviewdog 🐶
| const __context_gc_module = Dict{API.MlirContext, Set{API.MlirModule}}() | |
| const __context_gc_module = Dict{API.MlirContext,Set{API.MlirModule}}() |
closes #319
changes
Contextnow records ownership and callsmlirContextDestroyon finalization ifowner == truecontextmethods onAffineExpr,AffineMap,Attribute,Dialect,Identifier,IntegerSet,Location,Module,OperationandTypenow return a non-ownedContextremovedactivate!,deactivate!in favor ofwith_context, to avoid leakagereplaced the task-local storage of theContextstack with aScopedValueModuleleak by adding a fake dependencyOperationleak