My Implementation for c memory allocation