Ensure that there's no reflection on deserializing a string

This commit is contained in:
Joshua Suskalo 2021-09-15 21:33:05 -05:00
parent bf611f3106
commit 4a6cf4075e

View file

@ -380,18 +380,15 @@
(deserialize* type)))
(defmethod deserialize* ::c-string
[obj _type]
(CLinker/toJavaString obj))
(defn serialize
[])
[addr _type]
(CLinker/toJavaString ^MemoryAddress addr))
(defn deserialize
"Deserializes an arbitrary type regardless of if it is primitive.
"Deserializes an arbitrary type.
For types which have a primitive representation, this deserializes the
primitive representation. For types which do not, this deserializes out of
a [[MemorySegment]]."
a segment."
[obj type]
((if (primitive-type type)
deserialize*