Memory

Power-of-2 Bucketed Memory

All memory allocated internally by Rayve uses a 'power-of-2 bucketed' technology developed for Rayve. Thousands of transitory allocations and deletions can be done per frame with little performance impact. No defragmentation is required.

Memory Ownership

If a *Create() or *Init() function does not have an equivalent *Destroy() or *Rel() function, the memory is owned by the engine and will be released by the engine.

Containers

Containers use fast 'power-of-2 bucketed' memory system.

Negative indexes can be used to reference items from the end.

For buffered containers, the increment parameter specifies the number of items or string characters to expand when the container or string needs more memory. This increment doubles internally each expansion. For the initial increment value use a best estimate of the maximum items or characters expected during the container's lifetime. In buffered containers, items can potentialy change memory location.

For paged containers, the increment parameter specifies the number items per page. For the initial increment value use a per page value based on a sensible expansion given the expected usage pattern of the container. In paged containers, items do not change memory location.