macro for alloc memory