diff --git a/src/clj/coffi/ffi.clj b/src/clj/coffi/ffi.clj index 3d35d01..365fa10 100644 --- a/src/clj/coffi/ffi.clj +++ b/src/clj/coffi/ffi.clj @@ -499,10 +499,6 @@ inc))) acc)) [:invokeinterface IFn "invoke" (repeat (inc (count arg-types)) Object)] - (if (identical? ::mem/pointer (mem/primitive-type ret-type)) - [[:checkcast Long] - [:invokevirtual Long "longValue" [:long]] - [:invokestatic MemorySegment "ofAddress" [:long MemorySegment] true]]) (to-prim-asm ret-type) [(return-for-type ret-type :areturn)]]}]}) diff --git a/src/clj/coffi/mem.clj b/src/clj/coffi/mem.clj index 972b12d..23139c1 100644 --- a/src/clj/coffi/mem.clj +++ b/src/clj/coffi/mem.clj @@ -1247,7 +1247,7 @@ (defmethod serialize* ::c-string [obj _type ^Arena session] (if obj - (address-of (.allocateFrom session ^String obj)) + (.allocateFrom session ^String obj) (MemorySegment/NULL))) (defmethod deserialize* ::c-string