runtime: working on memalloc
some codegen cleanup