Hacker News new | past | comments | ask | show | jobs | submit login

Then you can't eat it too (or else you'll get very sick with NPEs/panics), sorry.



More specifically, it could result in undefined behavior, if a panic happens between the allocation and initialization (i.e., it was allocated, not initialized, panicked, and something observed the incomplete struct after the panic). Alternatively, the allocation would always have to leak on panic, or the struct would have to be deallocated without a destructor running.




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

Search: