Fix bug where only lists were allowed as types (which breaks)
This commit is contained in:
parent
1c5fbff3dd
commit
6758fdebe1
1 changed files with 7 additions and 1 deletions
|
|
@ -148,7 +148,7 @@
|
||||||
[type]
|
[type]
|
||||||
(cond
|
(cond
|
||||||
(qualified-keyword? type) type
|
(qualified-keyword? type) type
|
||||||
(list? type) (keyword (first type))))
|
(sequential? type) (keyword (first type))))
|
||||||
|
|
||||||
(defmulti c-layout
|
(defmulti c-layout
|
||||||
"Gets the layout object for a given `type`.
|
"Gets the layout object for a given `type`.
|
||||||
|
|
@ -223,6 +223,8 @@
|
||||||
([type] (alloc-instance type (connected-scope)))
|
([type] (alloc-instance type (connected-scope)))
|
||||||
([type scope] (MemorySegment/allocateNative ^long (size-of type) ^ResourceScope scope)))
|
([type scope] (MemorySegment/allocateNative ^long (size-of type) ^ResourceScope scope)))
|
||||||
|
|
||||||
|
(declare serialize serialize-into)
|
||||||
|
|
||||||
(defmulti serialize*
|
(defmulti serialize*
|
||||||
"Constructs a serialized version of the `obj` and returns it.
|
"Constructs a serialized version of the `obj` and returns it.
|
||||||
|
|
||||||
|
|
@ -243,6 +245,10 @@
|
||||||
{:type type
|
{:type type
|
||||||
:object obj}))))
|
:object obj}))))
|
||||||
|
|
||||||
|
(defmethod serialize* ::pointer
|
||||||
|
[obj type scope]
|
||||||
|
(alloc-instance (serialize obj (second type) scope)))
|
||||||
|
|
||||||
(defmulti serialize-into
|
(defmulti serialize-into
|
||||||
"Writes a serialized version of the `obj` to the given `segment`.
|
"Writes a serialized version of the `obj` to the given `segment`.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue