I have two questions:
1) Is it possible to implement an allocator that uses alloca to allocate memory on the stack and is otherwise C++ STL compliant?
If the
No, this kind of thing isn't possible. For a start, the STL expects to allocate more memory, then free the old memory. How are you going to do that on the stack?
The only thing even remotely equivalent to this is a conservative garbage collector.