add the infrastructure for releasing the memory