1 comment:
Patch Set #5, Line 171: xzalloc
xmalloc?
It's just a safety precaution to do this everywhere, I think (copied this from depthcharge). Otherwise you always have to carefully check whether you're *really* initializing every single member, and if anyone ever adds new members then they might forget to change code like this. It's easy to overlook things... for example, if I just changed this to xmalloc() without adding more code, the list_node pointers in the struct wouldn't get initialized to NULL.
(FWIW due to the way the heap in coreboot is currently implemented, allocations are always guaranteed to be zero-initialized anyway. We could optimize xzalloc() to just be a synonym for xmalloc() in coreboot. Not sure if it's worth the risk of someone changing the heap implementation later and not noticing, though. memset() on the L1 cache is cheap.)
To view, visit change 32861. To unsubscribe, or for help writing mail filters, visit settings.