Tuples may have attributes of three types: strings (up to 255 characters), integers, and real numbers (floats, in C++).
Because padding of bytes is needed to align integers and floats, the exact number of bytes in a Tuple is not known ahead of time. When tuples are created, a large number of bytes must be allocated. Then the attributes list (for example: string, int, float) is passed to the tuple and the tuple is constructed. During the Tuple construction, padding is performed and the actual size of the Tuple with those attributes is determined.
For our (string,int,float) example tuple, with the maximum length of the string being 5, and the architecture having 4-byte ints and floats, both requiring 4-byte alignment, the tuple internals would look like:
string | padding | int | float |
---|---|---|---|
5 bytes | 3 bytes | 4 bytes | 4 bytes |
The padding was added after the string to allow the int field to be placed at an offset that is a multiple of 4, as required by the example machine's architecture.
In Minibase, a tuple must fit on a single page.
Click here for the public interface.
Back to the List of Components
Back to the Minibase Home Page