And it does. The restriction (that it must be called from the 'root' scope of a program) is not one imposed by design (at least not intentionally), but is probably a side-effect of not having a 'proper' garbage collector, but instead relying on reference counts.
You tell me it does what I want, and then immediately start telling me about a restriction. I said:
No caveats, no restrictions, no weird usage rules ... discard all unused memory.
So long as we agree it's broken, we can move on.