pub trait Gc: GcPriv {
// Provided methods
fn enable_gc(&self, on: bool) -> bool { ... }
fn enable_gc_logging(&self, on: bool) { ... }
fn gc_is_enabled(&self) -> bool { ... }
fn gc_collect(&self, mode: GcCollection) { ... }
fn gc_safepoint(&self) { ... }
unsafe fn gc_safe_enter() -> i8 { ... }
unsafe fn gc_safe_leave(state: i8) { ... }
unsafe fn gc_unsafe_enter() -> i8 { ... }
unsafe fn gc_unsafe_leave(state: i8) { ... }
fn gc_set_max_memory(max_mem: u64) { ... }
}
Expand description
Provided Methods§
sourcefn enable_gc_logging(&self, on: bool)
fn enable_gc_logging(&self, on: bool)
Enable or disable GC logging.
This method is not available when the lts
feature is enabled.
sourcefn gc_is_enabled(&self) -> bool
fn gc_is_enabled(&self) -> bool
Returns true
if the GC is enabled.
sourcefn gc_collect(&self, mode: GcCollection)
fn gc_collect(&self, mode: GcCollection)
Force a collection.
sourcefn gc_safepoint(&self)
fn gc_safepoint(&self)
Insert a safepoint, a point where the garbage collector may run.
sourceunsafe fn gc_safe_enter() -> i8
unsafe fn gc_safe_enter() -> i8
Put the current task in a GC-safe state.
In a GC-safe state a task must not be calling into Julia, it indicates that the GC is allowed to collect without waiting for the task to reach an explicit safepoint.
Safety:
While in a GC-safe state, you must not call into Julia in any way that. It should only be used in combination with blocking operations to allow the GC to collect while waiting for the blocking operation to complete.
You must leave the GC-safe state by calling Gc::gc_safe_leave
with the state returned
by this function.
sourceunsafe fn gc_safe_leave(state: i8)
unsafe fn gc_safe_leave(state: i8)
Leave a GC-safe region and return to the previous GC-state.
Safety:
Must be called with the state returned by a matching call to Gc::gc_safe_enter
.
sourceunsafe fn gc_unsafe_enter() -> i8
unsafe fn gc_unsafe_enter() -> i8
Put the current task in a GC-unsafe state.
In a GC-unsafe state a task must reach an explicit safepoint before the GC can collect.
Safety:
This function must only be called while the task is in a GC-safe state. After calling this function the task may call into Julia again.
You must leave the GC-safe state by calling Gc::gc_unsafe_leave
with the state
returned by this function.
sourceunsafe fn gc_unsafe_leave(state: i8)
unsafe fn gc_unsafe_leave(state: i8)
Leave a GC-unsafe region and return to the previous GC-state.
Safety:
Must be called with the state returned by a matching call to Gc::gc_unsafe_enter
.
sourcefn gc_set_max_memory(max_mem: u64)
fn gc_set_max_memory(max_mem: u64)
Set GC memory trigger in bytes for greedy memory collecting