JuliaGPU / GPUArrays.jl

Reusable array functionality for Julia's various GPU backends.
MIT License
321 stars 79 forks source link

Mark arrays as free before releasing the data. #511

Closed maleadt closed 8 months ago

maleadt commented 8 months ago

Otherwise the GC can call unsafe_free while we were performing a manual unsafe_free.

We could make the freed field of DataRef atomic, but currently operations on the parent object aren't supposed to be thread-safe. Only the contained RefCounted is.

Fixes https://github.com/JuliaGPU/GPUArrays.jl/issues/503