Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> meaningfully slower

really ? there's a difference but unless you keep allocating in a hot-loop this should hardly ever have observable costs : https://gcc.godbolt.org/z/SN9Ois



The problem is with how to access other variables on the stack. Usually the compiler uses an offset from the stack pointer, which without VLA's is known at compile time. However, if you have VLA's, you might need a calculation at runtime to figure out where that variable is stored. Or maybe the offset from the frame pointer is known statically, but then you can't do the "omit frame pointer" optimization and you thus waste a register. Or if you have a variable that is between two VLA's, then you need a runtime calculation regardless.


Yes there is a talk done by Google at Linux Kernel Security Summit 2018 about it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: