On 13 May 2014 21:46, Jorge Acereda MaciĆ” <[email protected]> wrote: > ..[snip].. > Am I missing something? alloca() just adds an offset to the stack pointer:
This whole thread is fascinating :-) and while following up some of this dialogue with my own furious Googling I found a Stack Exchange Q&A which has great answers and comments, many defending alloca(), most however explaining why it (and VLAs) are apparently a bad idea for anything other than guaranteed *small* chunks: http://stackoverflow.com/questions/1018853/why-is-alloca-not-considered-good-practice at one point it links to another useful statement about them: http://compilers.iecc.com/comparch/article/91-12-079 One comment caused me to eventually stumble on Memory Pools: http://en.wikipedia.org/wiki/Memory_pools which seems like it might be one of the best compromises for what you are discussing (in terms of speed vs. safety/predictability). I am no C-guru, so I'll just throw that in there in case it's useful. Ignore it if it isn't. -- UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe
