ensure changing and resetting allocation.enable during deallocation