+ src/wave: Improved memory management