Add extra constructors for sessions

This commit is contained in:
Joshua Suskalo 2022-11-16 16:58:20 -06:00
parent 139341af99
commit 65c7544cc7
No known key found for this signature in database
GPG key ID: 9B6BA586EFF1B9F0

View file

@ -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.