The SSM runtime supports contiguous arrays of ssm_value_t. These are managed similarly to ADT objects (Algebraic data types), except the ssm_mm header in arrays use the 16-bit size field, meaning (1) there is no tag, and (2) arrays may accommodate up to 65536 fields (instead of 256).
◆ ssm_array_len
#define ssm_array_len |
( |
|
v | ) |
((v).heap_ptr->info.size) |
The length of an array pointed by v.
Definition at line 1016 of file ssm.h.
◆ ssm_array_elements
Obtain pointer to the array elements payload pointed to by @ a v.
Definition at line 1019 of file ssm.h.
◆ ssm_array_element
Obtain pointer to the ith element of the array pointed by v.
Definition at line 1023 of file ssm.h.
◆ ssm_array_size
Compute the size of an array with its header.
- Parameters
-
count | the number of array elements, i.e., the size field. |
- Returns
- size that a array of count elemtns occupies in the heap.
Definition at line 1030 of file ssm.h.
◆ ssm_array_heap_size
Compute the size an array in the heap from an ssm_value_t.
- Parameters
-
- Returns
- size of the array that v points to.
Definition at line 1038 of file ssm.h.
◆ ssm_new_array
#define ssm_new_array |
( |
|
c | ) |
|
Value: (fprintf(stderr,"%s:%d:ssm_new_array(%d)\n", \
__FILE__, __LINE__, (c)), \
ssm_new_array_int(c)
Definition at line 1051 of file ssm.h.
◆ ssm_new_array_int()
Allocate an array on the heap.
Note that this function returns an array with all elements uninitialized, which must be initialized before ssm_drop() can be called on the array.
- Parameters
-
count | number of ssm_value_t elements to be stored in the array. |
- Returns
- ssm_value_t pointing to heap-allocated array.
Definition at line 305 of file ssm-mem.c.