Contexts#

class unit::Context#

Manages memory for all UNIT objects. Procedures created with a context share its memory allocator. See UNIT_Context.

Context cannot be copied or moved. It must outlive all procedures and compiled objects created from it.

Context()#

Create and initialize a new context.

Throws:

std::runtime_error – If initialization fails.

Example#
unit::Context ctx;
unit::Procedure proc(ctx, "main");
~Context()#

Clear the context and free all associated memory.

UNIT_Context *raw()#

Return the underlying C context pointer.