News for hackers. Stuff that matters.
Re:Stop Memsetting Structures by FrozenVoid on Sunday April 28, 2019 @12:21AM (#19769331)
you can write your own memset that bypasses all of that. Its just 2 lines of code.
Re:Stop Memsetting Structures by gmueckl on Sunday April 28, 2019 @06:36AM (#19770368)
And that will be slower than calling memset() unless you have a really smart compiler.
Re:Stop Memsetting Structures by rurban on Sunday April 28, 2019 @06:52AM (#19770416)
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.
Re:Stop Memsetting Structures by rmtgk on Sunday April 28, 2019 @07:09AM (#19770474)
That's quite a bold claim. Care to explain further?
Re:Stop Memsetting Structures by rurban on Sunday April 28, 2019 @02:36PM (#19772816)
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.