Documentation about closureSize should be more precise
There are a few different interpretations of what the closureSize
operation in ghc-heap
could do.
- Tell you the size of just the top-level closure. For example, a list [1] is of size 3.
- Tell you the overall size of an "object" by following all the pointers from the closure. For example, the list [1] is of size 5.
I think the more intuitive answer is (2) but I suspect (1) is the case. Someone needs to check how closureSize
is implemented and update the documentation with a comment explaining which one it is.