Confused about PAP object layout

Ben Gamari ben at
Fri Feb 14 17:25:22 UTC 2020

Ömer Sinan Ağacan <omeragacan at> writes:

> I think that makes sense, with the invariant that n_args <= bitmap_size. We
> evacuate the arguments used by the function but not others. Thanks.
> It's somewhat weird to see an object with useful stuff, then garbage, then
> useful stuff again in the heap, but that's not an issue by itself. For example
> if I have something like
>     [pap_info, x, y, z]
> and according to the function `y` is dead, then after evacuating I get
>     [pap_info, x, <garbage>, z]
> This "garbage" is evacuated again and again every time we evacuate this PAP.
I'm not sure what you mean by "garbage". The bitmap merely determines
whether a field is a pointer, not whether it is copied during
evacuation. A field's bitmap bit not being set merely means that we won't
evacuate the value of that field during scavenging.

Nevertheless, this all deserves a comment in scavenge_PAP.


- Ben

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <>

More information about the ghc-devs mailing list