Bank Objects (Programming, Arrays)

Created: 2022-09-29T19:46:14-05:00

Return to the Index

A vector, sequence, or "stretchy buffer" is one that is resized as needed. It has a number of items contained and a capacity and will be reallocated (and thus move around in memory) when more capacity is needed.

A bank typically consists of zero or more blades which have a fixed size. Rather than reallocate and cause memory to move the bank grows by allocating a new blade somewhere else in memory and maintaining a reference to it.

Because blades do not move around it is possible to keep pointers directly to elements in memory. They can be accessed by this pointer or via index. Thus the cost of reindexing the bank is made in to a non-issue.

Orx project's Bank object