Question about GC.@preserve

jw3126
Mon, 01 Sep 2025 06:07:03 +0000
General Usage

Consider the following two patterns:

v = Vector(...)
GC.@preserve v begin
   # unsafe stuff using pointer(v)
end

and

v = Vector(...)
# unsafe stuff using pointer(v)
GC.@preserve v

Are there situations where the second pattern might cause trouble?

2 posts - 2 participants