FixIO Documentation

Back to summary

Extension methods

Shared arrays

import "io/shared";

function Array::get_view(elem_size: Integer): Value[]
function Array::get_view(off: Integer, len: Integer): Value[]
function Array::get_view(off: Integer, len: Integer, elem_size: Integer): Value[]
Creates a new shared array as a view into subset of given shared array. The offset and length are given as indicies in the original shared array. Optionally you can change the element size (non-aligned access is not permitted).

Note: When changing the element size the endianess of the CPU is exposed. This library supports little endian platforms only. Big endian platforms (if any) will be either unsupported or the little endianess will be emulated. This has been decided based on two factors: big endian CPUs are (outside of niches) a thing of the past and the little endian is more natural with regard to addressing. This restriction allows to use memory views for file formats and generally results into one thing less to worry about.