12-18-2025, 06:21 PM
Isn't the simplest way for multi-dim arrays:
Make a new array the size you want.
Copy over the data you want to preserve.
Resize old array
Copy Data back to old array (one single memcopy now, as the arrays are the same size and have the same indexes)
Delete/Clear new array.
It's not going to be quick, but it'll get the job done. And if you're resizing mutli-dimensional arrays constantly, you're doing something wrong.
Make a new array the size you want.
Copy over the data you want to preserve.
Resize old array
Copy Data back to old array (one single memcopy now, as the arrays are the same size and have the same indexes)
Delete/Clear new array.
It's not going to be quick, but it'll get the job done. And if you're resizing mutli-dimensional arrays constantly, you're doing something wrong.


