Variable Length Arrays

SSlib has support for small, variable-length, arrays with independent operations. The array elements can be either persistent object links or a user-defined datatype without embedded SSlib special types. The data for all variable length arrays in a scope is aggregated (together with the variable length strings) into a single dataset which is read in its entirety when a scope is opened.

The reason for the distinction between whether the array stores SSlib datatypes or not is because conversion between memory and file representations, calculation of checksums, and interprocess communication require facilities provided by SSlib for those types and aren’t available (or are handled entirely differently) for the non-SSlib datatypes. In practice this doesn’t turn out to be a problem because variable length arrays are generally only used to store persistent object links (as in a Set object pointing to Collections) or native integers (as in a Field’s permutation vector).

An array is born with zero elements of of ss_pers_t type. If the array is intended to store something other than object links then its datatype must be changed with ss_array_target. The number of elements in an array is changed with ss_array_resize. The ss_array_get and ss_array_put functions query or modify elements of an array and ss_array_reset sets the array back to an initial state.