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

Why would the comparison be useless?

I can imagine situations where a pointer q might sometimes be a copy of pointer p and sometimes might point to something else, and the code wants to free q if and only if it is not a copy of p (because p has been free'd earlier).



Because a new object can have the same address as p, so comparing to p isn't enough to tell you if you have a copy of p or a live pointer to something else.




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

Search: