From b029a41f6a2cbcb9d28d85e1e6beada9bff35189 Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Tue, 18 Jan 2022 13:28:43 -0600 Subject: [PATCH] Update type hinting for alloc-instance based on size-of --- src/clj/coffi/mem.clj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/clj/coffi/mem.clj b/src/clj/coffi/mem.clj index ad66d26..d11673b 100644 --- a/src/clj/coffi/mem.clj +++ b/src/clj/coffi/mem.clj @@ -397,8 +397,8 @@ (defn alloc-instance "Allocates a memory segment for the given `type`." - ([type] (alloc-instance type (connected-scope))) - ([type scope] (MemorySegment/allocateNative (long (size-of type)) ^ResourceScope scope))) + (^MemorySegment [type] (alloc-instance type (connected-scope))) + (^MemorySegment [type scope] (MemorySegment/allocateNative ^long (size-of type) ^ResourceScope scope))) (declare serialize serialize-into)