
4 Mar
2010
4 Mar
'10
1 p.m.
Daniel Larimer wrote:
It seems like it should be possible to implement a "smart stack allocation" scheme where new/delete are overloaded for some template type like
sstack<my_data> v1; ... In theory you could get most of the speed advantages of stack-based allocation and yet offload "big objects" to "heap" without having to worry about expensive malloc/free calls except when the sstack<> detects that it needs to expand.
You are looking for Thorsten's autobuffer? http://www.cs.aau.dk/~nesotto/boost/auto_buffer.zip Cheers, Rutger