Protect a CUDA macro from being expanded to something not intended.
I'm not sure there was a problem, just saw the dangerous definiton.
Change malloc() to mem_alloc() in a bunch of formats. The latter sits
in memory.c and has error checking.