pasim: moved memory implementation into .cc file