3 ms·
That sounds a lot like automatic memory management! To a C dev, that's the same as communism to a US Republican.
by ovi256 12y ago
That sounds a lot like automatic memory management!
To a C dev, that's the same as communism to a US Republican.
- dllthomas 12y agoAs a C dev, no. First, stack allocation is a type of "automatic memory management", and in most situations we C devs are perfectly comfortable with it. Second, in terms of how the memory is allocated/deallocated, the above doesn't sound any different than stack allocation. The difference is more like "volatile", telling the compiler "this memory is special, treat it carefully", and it mostly doesn't seem unreasonable. Note that C compilers frequently have extensions providing a way of naming destructors for particular variables. It probably would still be possible to skip it with a non-local jump (longjmp or computed goto) but avoiding those in security conscious code is probably already standard - it basically is in most code I've encountered.