The garbage collector scans the memory at unspecified times, determines the objects that cannot possibly be reached by the program, destroys them, and reclaims their memory locations.
The operations of the
GCmay be controlled by the programmer to some extent by
GC.callocand other functions reserve memory,
GC.reallocextends a previously allocated memory area, and
GC.freereturns it back to the
It is possible to mark the allocated memory by attributes like
.alignofproperty is the default memory alignment of a type. Alignment must be obtained by
classInstanceAlignmentfor class objects.
.offsetofproperty is the number of bytes a member is from the beginning of the object that it is a part of.
The align attribute specifies the alignment of a variable, a user-defined type, or a member.
destroy()executes the destructor of objects. One must destroy the struct pointee, not the struct pointer.
Object.factory()constructs objects with their fully qualified type names.