From e626cbf40b93dd97ead8b82c63181423c53597b6 Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Wed, 15 Sep 2021 12:41:11 -0500 Subject: [PATCH] Fix reflection warnings in allocateNative --- src/coffi/ffi.clj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coffi/ffi.clj b/src/coffi/ffi.clj index 49cdc5c..8438d0d 100644 --- a/src/coffi/ffi.clj +++ b/src/coffi/ffi.clj @@ -170,12 +170,12 @@ (defn alloc "Allocates `size` bytes." ([size] (alloc size (ResourceScope/newImplicitScope))) - ([size scope] (MemorySegment/allocateNative size scope))) + ([size scope] (MemorySegment/allocateNative ^long size ^ResourceScope scope))) (defn alloc-instance "Allocates a memory segment for the given `type`." ([type] (alloc-instance type (ResourceScope/newImplicitScope))) - ([type scope] (MemorySegment/allocateNative (size-of type) scope))) + ([type scope] (MemorySegment/allocateNative ^long (size-of type) ^ResourceScope scope))) (defn serialize "Serializes the `obj` into a newly-allocated [[MemorySegment]]."