defaultsHook isn't documented

Hello glasgow-haskell-users, it seems that defaultsHook isn't documented on http://www.haskell.org/ghc/docs/latest/html/users_guide/runtime-control.html... neither anywhere else in user manual -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

On 11/05/2009 11:01, Bulat Ziganshin wrote:
Hello glasgow-haskell-users,
it seems that defaultsHook isn't documented on http://www.haskell.org/ghc/docs/latest/html/users_guide/runtime-control.html... neither anywhere else in user manual
I think we'd like people to use ghc_rts_opts instead, if possible. Do you have a good reason to need defaultsHook instead? One problem with it is that defaultsHook ends up depending on the representation of the RtsFlags structure, which we change from time to time. Cheers, Simon

Hello Simon, Monday, May 18, 2009, 3:11:20 PM, you wrote:
it seems that defaultsHook isn't documented on
I think we'd like people to use ghc_rts_opts instead, if possible. Do you have a good reason to need defaultsHook instead? One problem with it is that defaultsHook ends up depending on the representation of the RtsFlags structure, which we change from time to time.
afaik, ghc_rts_opts can't built dynamically that means it cannot solve some problems. as example, the following hook allows haskell program to use up to 80% of RAM: void defaultsHook (void) { #ifdef _SC_PHYS_PAGES unsigned long long pagesize = sysconf(_SC_PAGESIZE); unsigned long long numpages = sysconf(_SC_PHYS_PAGES); unsigned long long mhs = numpages*pagesize*8/10; RtsFlags.GcFlags.maxHeapSize = 1ULL+mhs/BLOCK_SIZE_W; #endif } a good idea may be addition of hook that returns *string* with RTS options -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
participants (2)
-
Bulat Ziganshin
-
Simon Marlow