diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f2e455..edaf2e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/). ## [Unreleased] +### Fixed +- Non-primitive argument types fail to link ## [0.1.205] - 2021-10-06 ### Added diff --git a/src/clj/coffi/ffi.clj b/src/clj/coffi/ffi.clj index bfb497f..b44c6c9 100644 --- a/src/clj/coffi/ffi.clj +++ b/src/clj/coffi/ffi.clj @@ -20,6 +20,7 @@ CLinker FunctionDescriptor MemoryLayout + MemorySegment SegmentAllocator))) ;;; FFI Code loading and function access @@ -108,10 +109,10 @@ (defn- insn-layout "Gets the type keyword or class for referring to the type in bytecode." [type] - (when-some [prim (mem/primitive-type type)] - (if (not= prim ::mem/pointer) - (keyword (name prim)) - (mem/java-layout type)))) + (or (when-some [prim (mem/primitive-type type)] + (when (not= prim ::mem/pointer) + (keyword (name prim)))) + (mem/java-layout type))) (def ^:private unbox-fn-for-type "Map from type name to the name of its unboxing function."