Add a global resource scope
This commit is contained in:
parent
0e2fc6f458
commit
75910f0ab3
1 changed files with 10 additions and 0 deletions
|
|
@ -50,6 +50,16 @@
|
||||||
^ResourceScope []
|
^ResourceScope []
|
||||||
(ResourceScope/newImplicitScope))
|
(ResourceScope/newImplicitScope))
|
||||||
|
|
||||||
|
(defn global-scope
|
||||||
|
"Constructs the global scope, which will never reclaim its resources.
|
||||||
|
|
||||||
|
This scope may be shared across threads, but is intended mainly in cases where
|
||||||
|
memory is allocated with [[alloc]] but is either never freed or whose
|
||||||
|
management is relinquished to a native library, such as when returned from a
|
||||||
|
callback."
|
||||||
|
^ResourceScope []
|
||||||
|
(ResourceScope/globalScope))
|
||||||
|
|
||||||
(defn alloc
|
(defn alloc
|
||||||
"Allocates `size` bytes.
|
"Allocates `size` bytes.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue