Add extra constructors for sessions
This commit is contained in:
parent
139341af99
commit
65c7544cc7
1 changed files with 9 additions and 4 deletions
|
|
@ -38,6 +38,7 @@
|
||||||
ValueLayout$OfFloat
|
ValueLayout$OfFloat
|
||||||
ValueLayout$OfDouble
|
ValueLayout$OfDouble
|
||||||
ValueLayout$OfAddress)
|
ValueLayout$OfAddress)
|
||||||
|
(java.lang.ref Cleaner)
|
||||||
(java.nio ByteOrder)))
|
(java.nio ByteOrder)))
|
||||||
|
|
||||||
(set! *warn-on-reflection* true)
|
(set! *warn-on-reflection* true)
|
||||||
|
|
@ -47,8 +48,10 @@
|
||||||
|
|
||||||
The memory allocated within this session is cheap to allocate, like a native
|
The memory allocated within this session is cheap to allocate, like a native
|
||||||
stack."
|
stack."
|
||||||
^MemorySession []
|
(^MemorySession []
|
||||||
(MemorySession/openConfined))
|
(MemorySession/openConfined))
|
||||||
|
(^MemorySession [^Cleaner cleaner]
|
||||||
|
(MemorySession/openConfined cleaner)))
|
||||||
|
|
||||||
(defn ^:deprecated stack-scope
|
(defn ^:deprecated stack-scope
|
||||||
"Constructs a new scope for use only in this thread.
|
"Constructs a new scope for use only in this thread.
|
||||||
|
|
@ -63,8 +66,10 @@
|
||||||
|
|
||||||
This session can be shared across threads and memory allocated in it will only
|
This session can be shared across threads and memory allocated in it will only
|
||||||
be cleaned up once every thread accessing the session closes it."
|
be cleaned up once every thread accessing the session closes it."
|
||||||
^MemorySession []
|
(^MemorySession []
|
||||||
(MemorySession/openShared))
|
(MemorySession/openShared))
|
||||||
|
(^MemorySession [^Cleaner cleaner]
|
||||||
|
(MemorySession/openShared cleaner)))
|
||||||
|
|
||||||
(defn ^:deprecated shared-scope
|
(defn ^:deprecated shared-scope
|
||||||
"Constructs a new shared scope.
|
"Constructs a new shared scope.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue