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

> It turned out that the std::string empty string reference count was just doing a vanilla ++, no locking, nothing, variable not marked volatile, nothing.

The whole implementation is smells of silliness, because there is no need to track how many references there are to a global null string, which need not even be dynamically allocated.



I know; I've often wondered if this was changed, never went back to look.


Probably a few years ago, around C++11 time. Where the standard made it not possible to have a Copy-on-Write implementation of string.




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

Search: