fix build error with memalloc