This permits pre-allocating an array for collecting results, for
example. Suggested by Tony Finch.
:before :fragment
:first :fragment
:each :fragment
:before :fragment
:first :fragment
:each :fragment
+ :after :fragment
+ :count :id))
(defmethod compute-aggregating-message-kernel
((message aggregating-message) (combination (eql :custom))
codegen target methods arg-names
&key (retvar "sod_ret") (valvar "sod_val")
(defmethod compute-aggregating-message-kernel
((message aggregating-message) (combination (eql :custom))
codegen target methods arg-names
&key (retvar "sod_ret") (valvar "sod_val")
- decls before each (first each) after)
+ decls before each (first each) after count)
(let* ((type (c-type-subtype (sod-message-type message)))
(not-void-p (not (eq type c-type-void))))
(when not-void-p
(ensure-var codegen retvar type)
(ensure-var codegen valvar type))
(let* ((type (c-type-subtype (sod-message-type message)))
(not-void-p (not (eq type c-type-void))))
(when not-void-p
(ensure-var codegen retvar type)
(ensure-var codegen valvar type))
+ (when count
+ (ensure-var codegen count c-type-int (length methods)))
(when decls
(emit-decl codegen decls))
(labels ((maybe-emit (fragment)
(when decls
(emit-decl codegen decls))
(labels ((maybe-emit (fragment)