I'm trying to figure out how the guarded memory allocation works in blender. I'm reading the code inside mallocn.c and I'm struggling against the meaning of two defined macros.
The first one, MAKE_ID, for big endian machines, is defined as:
Code: Select all
MAKE_ID(a, b, c, d) ( (int)(a) << 24 | (int)(b) << 16 | (c) << 8 | (d))
Code: Select all
MAKE_ID(a, b, c, d) ( (int)(d) << 24 | (int)(c) << 16 | (b) << 8 | (a))
The second defined macro:
Code: Select all
MEMNEXT(x) ((MemHead *)(((char *)x) - ((char *)&(((MemHead *)0)->next))))
Thank you in advance...