A simpler remove HEAP_ALLOCED check

Edward Z. Yang ezyang at mit.edu
Mon Oct 20 01:30:56 UTC 2014


Hey Simon,

I was chatting with Sergio Benitez about GHC's HEAP_ALLOCED woes and he
suggested an alternate fix which I'm not sure we have considered.

The idea is simple: pre-assign some portion of the virtual address space
for the dynamic heap, and then have HEAP_ALLOCED check if it's inside
this space.

Now, *obviously* this doesn't work for 32-bit (and I assume this is why
we didn't go this route), but that's fine: the bitmap we use for 32-bit
works pretty great and isn't a bottleneck.  For 64-bit, we have a lot
more address space to play with.  Certainly we have to make sure the
system linker never puts segments inside our pre-assigned space, but
this seems far more manageable.

I'm not particularly wedded to the indirections patchset, so if we can
make this work for 64-bit, it seems good enough to me.

Edward


More information about the ghc-devs mailing list