consistently serialize strings to MemorySegment instead of addresses

(Longs) and remove ad-hoc upcall-class Long to MemorySegment conversion
This commit is contained in:
Kristin Rutenkolk 2024-07-23 15:39:58 +02:00
parent 0bf267e44a
commit 4160b1cb68
2 changed files with 1 additions and 5 deletions

View file

@ -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)]]}]})

View file

@ -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