Skip to content

Commit

Permalink
->pointer takes a long and there is a public API function to convert …
Browse files Browse the repository at this point in the history
…from a pointer to a long.
  • Loading branch information
cnuernber committed Oct 29, 2024
1 parent e86acdb commit 76afc20
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/tech/v3/datatype/ffi.clj
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,15 @@ Finally - on my favorite topic, efficiency, dtype-next has extremely fast copies
(convertible-to-pointer? [item] true)
;;Keep a reference to the native buffer so that it doesn't get GC'd while
;;this pointer is in scope.
(->pointer [item] (Pointer. (.address item) {:src-buffer item})))
(->pointer [item] (Pointer. (.address item) {:src-buffer item}))
Long
(convertible-to-pointer? [item] true)
(->pointer [item] (Pointer. (long item) nil)))


(defn pointer->address
^long [^Pointer p]
(.-address p))


(defn instantiate-class
Expand Down

0 comments on commit 76afc20

Please sign in to comment.