Skip to content

Calling dt-ffi/define-library-interface with a large interface throws "Method code too large!" exception. #115

@phronmophobic

Description

@phronmophobic

Trying to generate a large interface withdt-ffi/define-library-interface throws an Exception. I'm not sure what the approximate limit is.

The structs and interface can be found at https://gist.github.com/phronmophobic/ee367a0e846868b13be41e7e5af82d49.

Workaround:

Spitting up the interface into multiple calls and multiple classes seems to work:

(def dtype-interface (gen/api->library-interface api))
(defmacro chunk-define []
  `(do
     ~@(into
        []
        (comp (map-indexed
               (fn [i chunk]
                 (let [interface (into {} chunk)
                       classname (symbol (str (ns-name *ns* ) (str ".Bindings" i)))]
                   `(dt-ffi/define-library-interface (quote ~interface)
                      :classname (quote ~classname))))))
        (partition-all 5 dtype-interface))))

(chunk-define)

Macros and data FTW!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions