← Back to context

Comment by lerno

6 months ago

Alloca would not allow you to pass data from the current scope up to a parent scope.

I did say 10x better alloca. I'm saying that's not good enough, and seems very narrow.

You could do this in C++, with RAII stacked arena allocators. Though it's unclear to me from the blog post if C3 would prevent returning a pointer to memory in the top most pool. C++ probably wouldn't help you prevent that.