Performance of small allocations via prim ops

Sylvain Henry sylvain at haskus.fr
Wed Apr 12 10:06:12 UTC 2023


> One complication is that currently GHC has no way to know the value of
> LARGE_OBJECT_THRESHOLD (which is a runtime system macro). Typically to
> handle this sort of thing we use utils/deriveConstants to generate a
> Haskell binding mirroring the value of the C declaration. However,
> as GHC becomes runtime-retargetable we may need to revisit this design.

Since 
https://gitlab.haskell.org/ghc/ghc/-/commit/085983e63bfe6af23f8b85fbfcca8db4872d2f60 
(2021-03) we don't do this. We only read constants from the header file 
provided by the RTS unit. Adding one more constant for 
LARGE_OBJECT_THRESHOLD shouldn't be an issue.

Cheers

Sylvain



More information about the ghc-devs mailing list