use size_t type parameter for memory allocation function