On Fri, Feb 28, 2020 at 01:43 AM, Drew Derbyshire wrote:
The limits of 4K addressability and the need for stack frame pointers imposes most of the same overhead.? The primary (perhaps only) only additional overhead would be actual allocation/freeing of memory.
Can you please explain the 4k addressability point, I don't know what that means. Thank you.
As for the overhead, the big problem is having a really efficient way to determine (each time you move the stack pointer) if you have run out of stack space.?
I am not too worried about allocating or freeing memory from time to time and having complex logic to handle the jump from one bit of the stack in one place and another somewhere else because this will be relatively infrequent. After all each chunk of the dynamic stack can be large.
But you don't want to do that each function call. You need something really quick to check if the pointer is about to run out of the chunk of memory it is using. (Shrinking is possibly easier, but you need something fast here too). So does that mean we would reserve another register to hold the end of the chunk, and have to compare the value of the two registers each time you enter a function? Impact on performance? Etc ...