module GC
Defined in:
gc.crgc/boehm.cr
gc/none.cr
Class Method Summary
- .add_finalizer(object : Reference) : Nil
- .add_finalizer(object)
- .add_root(object : Reference)
- .collect
- .disable
- .enable
- .free(pointer : Pointer(Void)) : Nil
- .init
- .is_heap_ptr(pointer : Pointer(Void)) : Bool
-
.malloc(size : Int) : Pointer(Void)
Allocates and clearssize bytes of memory.
-
.malloc_atomic(size : Int) : Pointer(Void)
Allocatessize bytes of pointer-free memory.
- .prof_stats
-
.realloc(pointer : Pointer(T), size : Int) : Pointer(T) forall T
Changes the allocated memory size ofpointer tosize.
- .register_disappearing_link(pointer : Pointer(Pointer(Void)))
- .set_stackbottom(stack_bottom : Pointer(Void))
- .stats : GC::Stats
Class Method Detail
Allocates and clearssize bytes of memory.
The resulting object may contain pointers and they will be tracked by the GC.
The memory will be automatically deallocated when unreferenced.
Allocatessize bytes of pointer-free memory.
The client promises that the resulting object will never contain any pointers.
The memory is not cleared. It will be automatically deallocated when unreferenced.
Changes the allocated memory size ofpointer tosize. If this can't be done in place, it allocatessize bytes of memory and copies the content ofpointer to the new location.
Ifpointer was allocated with.malloc_atomic, the same constraints apply.
The return value is a pointer that may be identical topointer or different.
WARNING Memory allocated usingPointer.malloc must be reallocated using
Pointer#realloc instead.