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

> 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.




Applications are open for YC Winter 2018

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: