-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set finalizer on underlying
Memory
object in Julia 1.11+
In Julia 1.11+ with the new `Memory` object, the memory is not actually owned by the constructed `Array` and therefore the finalizer may trigger too early when the underlying memory is transfered from an `Array` to a different kind of owner (such as `IOBuffer`). Fix this by conditionally checking for the Julia 1.11+ behavior, and instead setting the finalizer on the `Memory`, if necessary. Duplicates the improvement made to the Mmap stdlib's implementation: JuliaLang/julia#54210
- Loading branch information
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters