remove alloc.h, unify memory functions into val.h