News for hackers. Stuff that matters.
Re:Memory Management in Python by jakear on Monday August 05, 2019 @12:20PM (#20615347)
Reserve a fixed amount and pull from it. That’s why I say it won’t work for larger programs. Though, you could resort to normal malloc after your stack memory runs out. This would get you the improved startup performance and runtime performance for smaller programs (those that use less memory than you initially reserve), without sacrificing anything on larger programs.

Edit: to be clear, I’m pretty sure that initial block could be reserved on the heap. The benefit comes from the large initial allocation, not from the memory being on the stack.

Re:Memory Management in Python by mehrdadn on Monday August 05, 2019 @12:29PM (#20615443)
Do you mean you're compiling the interpreter from scratch with C/C++ code that performs this initial allocation? It's really confusing trying to decipher what you're doing, since it doesn't sound like something that you could do to an existing CPython interpreter without corrupting memory...
Re:Memory Management in Python by jakear on Monday August 05, 2019 @12:41PM (#20615568)
Yep! Building from the C source. If you check out the demo I linked in another comment, it’s just a couple additional files in the CPython repo.