4 ms·
Ok, what's wrong with alloca? Other than blowing the stack, that is.
by mcguire 11y ago
Ok, what's wrong with alloca? Other than blowing the stack, that is.
- haberman 11y agoSee: https://google.github.io/styleguide/cppguide.html#Variable-Length_Arrays_and_alloca__ https://google.github.io/styleguide/cppguide.html#Variable-L... At least that's the rationale for why we don't use it at Google.
- mcguire 11y ago"More importantly, they allocate a data-dependent amount of stack space that can trigger difficult-to-find memory overwriting bugs: "It ran fine on my machine, but dies mysteriously in production"." Yep, blowing the stack will do that.