Skip to content

Commit d2113b3

Browse files
committed
Use GC.@preserve; should this be made optional with preserve and not-preserved macros; sometimes all arguments are pointers to global variables and these should therefore be guaranteed to be preserved; being pointers, @preserve-ing them wont help protect the thing they're pointing to anyway if I understand correctly.
1 parent b17b508 commit d2113b3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/LoopVectorization.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,13 +316,16 @@ end
316316

317317
# display(q)
318318
# We are using pointers, so better add a GC.@preserve.
319-
# gcpreserve = true
320-
gcpreserve = false
319+
gcpreserve = true
320+
# gcpreserve = false
321321
if gcpreserve
322-
return Expr(:macrocall,
322+
return quote
323+
$(Expr(:macrocall,
323324
Expr(:., :GC, QuoteNode(Symbol("@preserve"))),
324325
LineNumberNode(@__LINE__), (keys(indexed_expressions))..., q
325-
)
326+
))
327+
nothing
328+
end
326329
else
327330
return q
328331
end

0 commit comments

Comments
 (0)