Added memory allocation inline functions (part 1).