Manual memory

Core exposes allocation and release as explicit language operations while deriving sizes and alignment from the compilation target.

Stack values

Ordinary local values use automatic stack storage. Struct construction returns a value directly and does not allocate heap memory.

Vector3 position = Vector3 { 1.0f, 2.0f, 3.0f };

Heap allocation

new T(...) computes the target ABI size of T, allocates suitably aligned storage, constructs the value and returns T*.

Vector3* position = new Vector3(1.0f, 2.0f, 3.0f);

position->Y = 8.0f;

Brace construction may also be used directly in a heap allocation.

Vector3* origin = new Vector3 { 0.0f, 0.0f, 0.0f };

Release

free(pointer) ends the lifetime of a heap allocation and returns its storage to the native allocator. A declared struct destructor runs before the release.

free(position);
free(origin);
Ownership

The program that allocates a value is responsible for defining when its native storage is released.