Skip to content

module GC

Class methods

.add_finalizer(object : Reference)

View source

.add_finalizer(object)

View source

.add_root(object : Reference)

View source

.collect

View source

.disable

View source

.enable

View source

.free(pointer : Pointer(Void))

View source

.init

View source

.is_heap_ptr(pointer : Pointer(Void))

View 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.

View 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.

View source

.prof_stats

View source

.realloc(pointer : Pointer(Void), size : Int) : Pointer(Void)

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.

View source

.register_disappearing_link(pointer : Pointer(Pointer(Void)))

View source

.set_stackbottom(stack_bottom : Pointer(Void))

View source

.stats

View source