This is pure in the sense that it does not affect the visible controlled state, which means that for the purpose of code contracts, a method call cannot violate class invariants.
Of course, it is a little misleading to think of the method as pure, as it has side effects, even if these side effects are not visible. They are observable (if you try to use the pointer after it is released, you will fail), but not exactly visible (you cannot say without trying to use the pointer that something is wrong.) I'm not sure what was the motive for marking the Pure method since I cannot understand why this was ever used in the Contracts block, but I suppose there must have been some reason somewhere deep in the BCL contracts that required it.
source share