MCPcopy Create free account
hub / github.com/aiscriptdev/aiscript / free_gc_box

Function free_gc_box

aiscript-arena/src/context.rs:592–600  ·  view source on GitHub ↗

SAFETY: the gc_box must never be accessed after calling this function.

(mut gc_box: GcBox)

Source from the content-addressed store, hash-verified

590
591// SAFETY: the gc_box must never be accessed after calling this function.
592unsafe fn free_gc_box(mut gc_box: GcBox) {
593 unsafe {
594 if gc_box.header().is_live() {
595 // If the alive flag is set, that means we haven't dropped the inner value of this object,
596 gc_box.drop_in_place();
597 }
598 gc_box.dealloc();
599 }
600}
601
602/// Helper type for managing phase transitions.
603struct PhaseGuard<'a> {

Callers 2

dropMethod · 0.85
do_collection_innerMethod · 0.85

Calls 4

is_liveMethod · 0.80
headerMethod · 0.80
drop_in_placeMethod · 0.80
deallocMethod · 0.80

Tested by

no test coverage detected