Fix reflection warnings in allocateNative

This commit is contained in:
Joshua Suskalo 2021-09-15 12:41:11 -05:00
parent 181db81dd6
commit e626cbf40b

View file

@ -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]]."