Hi - The power of the Teensy 4 is amazing, blazing fast. But I wonder about using it for building arrays on the fly, I know there is no memory manager like windows. Does anyone know the best way of adding a new element to a 1D array everytime around a loop? I'm thinking about limiting the size of arrays by tracking & capping its size at runtime rather than pre-allocating maximum size arrays all over the place that are going to waste precious memory. Is this unwise due to memory fragmentation etc? Should I use malloc() / new? I'm thinking with the power of the Teensy it may be OK to do this but I'm not sure how to best manage the memory (or even if its a bad idea), if the array starts with a single element and it grows by 1 element every time around the loop, after 1000 iterations would I endup with 1000 blocks of memory used that can't use again unless I explicitly free all the blocks of memory?
Sorry for such a question on my first post!
Sorry for such a question on my first post!