In computer science, this is a standard strategy for allocating blocks of memory.
Suppose you have some stream of data that will end at some point. This could come from a user input or a computation that you don’t want to repeat. You want to store all the results in a contiguous block of memory. You can ask for a block of memory of any size you want. The strategy here is that whenever you run out of space, you ask for a block that’s twice as big and move all your data to it.
In computer science, this is a standard strategy for allocating blocks of memory.
Suppose you have some stream of data that will end at some point. This could come from a user input or a computation that you don’t want to repeat. You want to store all the results in a contiguous block of memory. You can ask for a block of memory of any size you want. The strategy here is that whenever you run out of space, you ask for a block that’s twice as big and move all your data to it.