From 9e7aab273e258b16829369ab449be98d9b3c4fad Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Mon, 20 Sep 2021 20:12:32 -0500 Subject: [PATCH] Move java layout to a simple function --- src/coffi/ffi.clj | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/coffi/ffi.clj b/src/coffi/ffi.clj index 2a3a6b1..1a945b2 100644 --- a/src/coffi/ffi.clj +++ b/src/coffi/ffi.clj @@ -227,15 +227,11 @@ ::pointer MemoryAddress ::void Void/TYPE}) -(defmulti java-layout +(defn java-layout "Gets the Java class to an argument of this type for a method handle. - If a type serializes to a primitive it should return a Java primitive type. - - Otherwise, it should return [[MemorySegment]]." - type-dispatch) - -(defmethod java-layout :default + If a type serializes to a primitive it returns return a Java primitive type. + Otherwise, it returns [[MemorySegment]]." [type] (java-prim-layout (or (primitive-type type) type) MemorySegment))