3 ms·
Because it's fairly common to design structures so that zero-initialized memory is a valid object. Eg that's how Cap’n Proto "decodes" messages in 0us even when
by NavinF 4y ago
Because it's fairly common to design structures so that zero-initialized memory is a valid object. Eg that's how Cap’n Proto "decodes" messages in 0us even when fields have default values: https://capnproto.org/ https://capnproto.org/
Also see "0 is special" by Linus https://yarchive.net/comp/linux/zero.html https://yarchive.net/comp/linux/zero.html
(Zeroing out memory that you know you're going to overwrite is indeed wasteful because at least some of those pages will end up getting zeroed twice.)