1#ifndef REDUCT_FUNCTION_IMPL_H
2#define REDUCT_FUNCTION_IMPL_H 1
69 func->
insts = newInsts;
Core definitions and structures.
#define REDUCT_REALLOC(_ptr, _size)
#define REDUCT_ASSERT(_cond)
#define REDUCT_FREE(_ptr)
REDUCT_API reduct_function_t * reduct_function_new(reduct_t *reduct)
REDUCT_API void reduct_function_grow(reduct_t *reduct, reduct_function_t *func)
REDUCT_API reduct_const_t reduct_function_lookup_constant(reduct_t *reduct, reduct_function_t *func, reduct_const_slot_t *slot)
#define REDUCT_ERROR_RUNTIME(_reduct,...)
Throw a runtime error using the jump buffer in the error structure.
#define REDUCT_ERROR_INTERNAL(_reduct,...)
Throw an internal error using the jump buffer in the error structure.
reduct_uint16_t reduct_const_t
Constant index type.
REDUCT_API void reduct_function_init(reduct_function_t *func)
Initialize a function structure.
REDUCT_API void reduct_function_deinit(reduct_function_t *func)
Deinitialize a function structure.
reduct_uint32_t reduct_inst_t
Instruction type.
#define REDUCT_CONSTANT_MAX
The max number of constants per function.
#define REDUCT_ITEM_TYPE_FUNCTION
A function.
REDUCT_API reduct_item_t * reduct_item_new(struct reduct *reduct)
Allocate a new Reduct item.
reduct_const_slot_type_t type
The type of the constant slot.
Compiled function structure.
reduct_inst_t * insts
An array of instructions.
reduct_const_slot_t * constants
The array of constant slots forming the constant template.
reduct_uint16_t constantCapacity
Capacity of the constant array.
reduct_uint32_t instCapacity
Capacity of the instruction array.
reduct_uint32_t instCount
Number of instructions.
reduct_uint32_t * positions
An array of source positions parallel to the instructions.
reduct_uint16_t registerCount
The number of registers the function uses.
reduct_uint16_t constantCount
Number of constants.
reduct_uint8_t arity
The number of arguments the function expects.
reduct_function_t function
A function.
reduct_item_type_t type
The type of the item.