From 6cc17f463efbac8b086385aaccce0db6125cb7d1 Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Fri, 17 Sep 2021 14:02:06 -0500 Subject: [PATCH] Update qsort example --- src/coffi/ffi.clj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coffi/ffi.clj b/src/coffi/ffi.clj index f3ac162..b4dd7c8 100644 --- a/src/coffi/ffi.clj +++ b/src/coffi/ffi.clj @@ -882,6 +882,7 @@ "qsort" [::pointer ::long ::long (fn [::pointer ::pointer] ::int)] ::void + qsort-native [type comparator list] (with-open [scope (stack-scope)] (let [copied-list (alloc (* (count list) (size-of type)) scope) @@ -890,7 +891,7 @@ (let [obj1 (deserialize-from type (slice-global addr1 (size-of type))) obj2 (deserialize-from type (slice-global addr2 (size-of type)))] (comparator obj1 obj2)))] - (qsort copied-list (count list) (size-of type) comp-fn) + (qsort-native copied-list (count list) (size-of type) comp-fn) (for [segment (seq-of type copied-list)] (deserialize-from type segment))))) )