General concepts, things to change in the code:
- Change use of 'iterator' into 'int'. Very simple, modify 'begin() and 'end()' to reflect 0, and current last element.
- begin() is just '0'. if 'end()' is 0, then the vector is empty.
- Just add these methods to a class that contains the array, and keep a maximum size of the array. *Allocate that size on initialization*.
- It can be static or from a pool. This helps fix the memory fragmentation problems that occur when allocations and frees occur while the app executes in real time.
No comments:
Post a Comment