memalloc.c additions