J
James Kanze
James Kanze wrote:
[...]
That is an interesting distinction. Do you happen to know of
any modern platforms for which "zero initialized" POD objects
require memory with non-zero bit-patterns?
Off hand, no, but that doesn't mean that one would surprise me.
I spent some years working with microprocessor design teams, and
0xdeadbeef was a common starting value for buses during simulations, to
make it clear that no value had yet been assigned to the bus. The only
time I've seen even a vaguely similar technique used in software is for
the magic numbers that sometimes identify file types, e.g. the
0xcafebabe at the beginning of Java .class files.
I'm certain that I've seen it somewhere. I use it in my debug
operator new/operator delete, but I certainly didn't invent it.