define macros for all memory functions