mem: rework memzone to be allocated by malloc