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