Fix bug where primitive arg optimizations weren't applied to cfn
This commit is contained in:
parent
2ff4d9ba52
commit
aa93014f83
2 changed files with 6 additions and 10 deletions
|
|
@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This change
|
|||
|
||||
## [Unreleased]
|
||||
### Fixed
|
||||
- All-primitive method types still used serialization when called from `cfn`
|
||||
- Arrays deserialized to non-vector sequences
|
||||
- Non-primitive argument types fail to link
|
||||
|
||||
|
|
|
|||
|
|
@ -269,7 +269,10 @@
|
|||
(-> symbol
|
||||
ensure-address
|
||||
(make-downcall args ret)
|
||||
(make-serde-wrapper args ret)))
|
||||
(cond->
|
||||
(every? #(= % (mem/primitive-type %))
|
||||
(cons ret args))
|
||||
(make-serde-wrapper args ret))))
|
||||
|
||||
(defn vacfn-factory
|
||||
"Constructs a varargs factory to call the native function referenced by `symbol`.
|
||||
|
|
@ -548,7 +551,6 @@
|
|||
args-types (gensym "args-types")
|
||||
ret-type (gensym "ret-type")
|
||||
address (gensym "symbol")
|
||||
invoke (gensym "invoke")
|
||||
native-sym (gensym "native")
|
||||
[arity fn-tail] (-> args :wrapper :fn-tail)
|
||||
fn-tail (case arity
|
||||
|
|
@ -562,14 +564,7 @@
|
|||
`(let [~args-types ~(:native-arglist args)
|
||||
~ret-type ~(:return-type args)
|
||||
~address (find-symbol ~(name (:symbol args)))
|
||||
~invoke (make-downcall ~address ~args-types ~ret-type)
|
||||
~(or (-> args :wrapper :native-fn) native-sym)
|
||||
~(if (and (every? #(= % (mem/primitive-type %))
|
||||
(:native-arglist args))
|
||||
(= (:return-type args)
|
||||
(mem/primitive-type (:return-type args))))
|
||||
invoke
|
||||
`(make-serde-wrapper ~invoke ~args-types ~ret-type))
|
||||
~native-sym (cfn ~address ~args-types ~ret-type)
|
||||
fun# ~(if (:wrapper args)
|
||||
`(fn ~(:name args)
|
||||
~@fn-tail)
|
||||
|
|
|
|||
Loading…
Reference in a new issue