module

GC

Class methods

add_finalizer(object : Reference) : Nil
Source
add_finalizer(object)
Source
add_root(object : Reference)
Source
collect
Source
disable
Source
enable
Source
free(pointer : Pointer(Void)) : Nil
Source
init
Source
is_heap_ptr(pointer : Pointer(Void)) : Bool
Source
malloc(size : Int) : Pointer(Void)

Allocates and clears size 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.

Source
malloc_atomic(size : Int) : Pointer(Void)

Allocates size 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.

Source
prof_stats
Source
realloc(pointer : Pointer(T), size : Int) : Pointer(T) forall T

Changes the allocated memory size of pointer to size. If this can't be done in place, it allocates size bytes of memory and copies the content of pointer to the new location.

If pointer was allocated with malloc_atomic, the same constraints apply.

The return value is a pointer that may be identical to pointer or different.

WARNING: Memory allocated using Pointer.malloc must be reallocated using Pointer#realloc instead.

Source
set_stackbottom(thread_handle : Pointer(Void), stack_bottom : Pointer(Void))
Source
set_stackbottom(thread : Thread, stack_bottom : Pointer(Void))
Source
stats
Source

Nested types