ssm
0.0.2
Runtime Library for the Sparse Synchronous Model
|
The struct template of a heap-allocated closure object. More...
#include <ssm.h>
Data Fields | |
struct ssm_mm | mm |
Memory management header. More... | |
ssm_func_t | f |
Enter function pointer. More... | |
ssm_value_t | argv [1] |
An array of arguments. More... | |
The struct template of a heap-allocated closure object.
This struct is meant to be used as a template for performing other closure-related pointer arithmetic; no instance of this should ever be declared. See elaborated discussion about this pattern for ssm_adt1.
A closure should always be allocated with enough space in argv to accommodate all arguments expected by the enter function f, so faciliate efficient in-place usage.
The current number of arguments owned by the closure is tracked by the memory management header's val_count field; the reference counts of the argv fields within this range need to be decremented when the enclosing closure is freed. The total number of arguments accommodated by the closure is tracked by the tag field; this also determines the size of the closure object.
ssm_value_t argv[1] |