If there is no other suggestion/concern , it seems the above concern might be addressed by using pre-allocated memory to satisfy the mostly used case, and use the dynamically allocated memory if/when necessary.
If there is no other suggestion/concern , it seems the above concern might be addressed by using pre-allocated memory to satisfy the mostly used case, and use the dynamically allocated memory if/when necessary.