7 ms·
I don't get it. How can UB on double-free, use-after-free, dangling pointers, etc lead to optimizations?
by iwsk 3y ago
I don't get it.
How can UB on double-free, use-after-free, dangling pointers, etc lead to optimizations?
- lifthrasiir 3y agoMaking double-free an UB makes `free` more efficient because there are less checks to make. Combined with use-after-free as an UB, that deallocated memory can be immediately reused for the next allocation without any repercussion. And making dangling pointer an UB makes most pointer analysis much more doable.