Skip to content

Documentation about closureSize should be more precise

There are a few different interpretations of what the closureSize operation in ghc-heap could do.

  1. Tell you the size of just the top-level closure. For example, a list [1] is of size 3.
  2. 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.

Edited by Matthew Pickering
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information