-
Notifications
You must be signed in to change notification settings - Fork 9
refcount: Use performBlockingMajorGC if available
#492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@dcoutts This uses |
|
@dcoutts This still requires I'll look into what it actually does. In the meantime, this is WIP. |
|
From cursory reading of GHC source, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this whole thing could be a lot simpler.
How about:
import qualified System.Mem
and then
-- Later GHC versions have 'performBlockingMajorGC' which does a full GC even
-- when using the concurrent incremental collector. This is what we want to ensure
-- all forgotten refs are found.
#if MIN_VERSION_base(4,20,0)
performBlockingMajorGC = System.Mem.performBlockingMajorGC
#else
performBlockingMajorGC = System.Mem.performMajorGC
#endif
and otherwise in checkForgottenRefs, keep it the same as originally but replace performMajorGC with performBlockingMajorGC. And the comment you added is good too.
But there's nothing magic about performBlockingMajorGC that means we don't need yield or that means we should do it once vs twice. The performBlockingMajorGC is just the same as performMajorGC in older GHC versions except that it provides the same guarantee for the incremental GC as the non-incremental: that it scans the whole heap.
dcoutts
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now. Please squash and merge.
9662e61 to
d8d5b19
Compare
7451eb9 to
544385e
Compare
|
Unclear what's up with stylish-haskell. |
544385e to
f1a646c
Compare
performBlockingMajorGCperformBlockingMajorGC if available
|
No description provided.