Skip to content

Commit

Permalink
moving away from nio buffer string pathways
Browse files Browse the repository at this point in the history
  • Loading branch information
cnuernber committed Sep 5, 2023
1 parent f39c78c commit 8ceda14
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{:paths ["src"]
:deps {org.clojure/clojure {:mvn/version "1.11.1" :scope "provided"}
cnuernber/dtype-next {:mvn/version "10.000"}
cnuernber/dtype-next {:mvn/version "10.009-SNAPSHOT"}
net.java.dev.jna/jna {:mvn/version "5.12.1"}
org.clojure/data.json {:mvn/version "1.0.0"}
;;Replace me with caffeine...
Expand Down
7 changes: 1 addition & 6 deletions src/libpython_clj2/python/ffi.clj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
[tech.v3.datatype.struct :as dt-struct]
[tech.v3.datatype.errors :as errors]
[tech.v3.datatype.native-buffer :as native-buffer]
[tech.v3.datatype.nio-buffer :as nio-buffer]
[tech.v3.datatype.protocols :as dt-proto]
[tech.v3.resource :as resource]
[libpython-clj2.python.gc :as pygc]
Expand Down Expand Up @@ -793,11 +792,7 @@ Each call must be matched with PyGILState_Release"}
(size-obj 0)
nil)]
(native-buffer/free size-obj)
(-> (.decode StandardCharsets/UTF_8
;;avoid resource chaining for performance
^java.nio.ByteBuffer (nio-buffer/native-buf->nio-buf
nbuf {:resource-type nil}))
(.toString))))
(native-buffer/native-buffer->string nbuf)))

(defn pytype-name
^String [type-pyobj]
Expand Down

0 comments on commit 8ceda14

Please sign in to comment.