Use XCALLOC / XZALLOC macros where reasonable