Skip to content

Commit 00629d2

Browse files
committed
Don't pass the kernel state to runtime functions when they don't need one.
1 parent d0a4612 commit 00629d2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/optim.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,11 @@ function lower_gc_frame!(fun::LLVM.Function)
322322
Builder(ctx) do builder
323323
# NOTE: this happens late during the pipeline, where we may have to
324324
# pass a kernel state arguments to the runtime function.
325-
state = kernel_state_type(job)
325+
state = if job.source.kernel
326+
kernel_state_type(job)
327+
else
328+
Nothing
329+
end
326330

327331
position!(builder, call)
328332
ptr = call!(builder, Runtime.get(:gc_pool_alloc), [sz]; state)

0 commit comments

Comments
 (0)