Skip to content

Commit

Permalink
Struct doc suggestions (#111)
Browse files Browse the repository at this point in the history
* Update native-buffer/malloc docs to more directly pointer to
resource-type docs.

* Add 2-arity call to `dt-struct/map->struct`.
  • Loading branch information
phronmophobic authored Sep 20, 2024
1 parent f2f3531 commit 9899297
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/tech/v3/datatype/native_buffer.clj
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@
Options:
* `:resource-type` - defaults to `:gc` - maps to `:track-type` in `tech.v3.resource`
* `:resource-type` - defaults to `:gc` - maps to `:track-type` in `tech.v3.resource/track`
but can also be set to nil in which case the data is not tracked this library will
not clean it up.
* `:uninitialized?` - do not initialize to zero. Use for perf in very very rare cases.
Expand Down
8 changes: 5 additions & 3 deletions src/tech/v3/datatype/struct.clj
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,11 @@ user> *2


(defn map->struct
[dtype data track-type]
(map->struct! data (new-struct dtype {:container-type :native-heap
:resource-type track-type})))
([dtype data]
(map->struct dtype data :gc))
([dtype data track-type]
(map->struct! data (new-struct dtype {:container-type :native-heap
:resource-type track-type}))))


(declare inplace-new-array-of-structs)
Expand Down

0 comments on commit 9899297

Please sign in to comment.