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

you can write your own memset that bypasses all of that. Its just 2 lines of code.



And that will be slower than calling memset() unless you have a really smart compiler.


I don't trust any memset at all. Literally every single memset I looked at was either broken, too slow or insecure. Mostly the wellknown glibc, freebsd, msvcrt and compiler implementations.


That's quite a bold claim. Care to explain further?


I already explained it. Noone implements memory barriers in its safe variants, only compiler barriers. And the trivial variants work byte-wise, not word-wise, which is usually 8x slower.




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

Search: