memalloc and freemem