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

> A function like strcmp() cannot assume that if it sees the same pointer multiple times that this pointer contains the same data

For arbitrary pointers no. But it could special-case e.g. string constants in the source code and/or pointers returned by some intern function (which is also how the JVM does it - for arbitrary strings, even though they're objects, it's always possible that the object has been GCed and another string allocated at the same location).




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

Search: