Skip to content
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

fix(swingset,xsnap): add gcAndFinalize, tests #3136

Merged
merged 2 commits into from
May 21, 2021
Merged

Commits on May 21, 2021

  1. feat(xsnap): add gcAndFinalize, tests

    This changes the xsnap.c run loop to give finalizers a chance to run just
    after the promise queue drains.
    
    With this change, userspace can do a combination of `gc()` and `setImmediate`
    that lets it provoke a full GC sweep, and wait until finalizers have run.
    SwingSet will use this during a crank, after userspace has become idle, and
    before end-of-crank GC processing takes place.
    
    This combination is implemented in a function named `gcAndFinalize()`. We
    copy this function from its normal home in SwingSet so the xsnap.c behavior
    it depends upon can be tested locally.
    
    refs #2660
    warner committed May 21, 2021
    Configuration menu
    Copy the full SHA
    343d908 View commit details
    Browse the repository at this point in the history
  2. fix(swingset): add gcAndFinalize, tests

    This adds a platform-specific `gcAndFinalize()` function, which returns a
    Promise that resolves when GC has been provoked and FinalizationRegistry
    callbacks have had a chance to run.
    
    On Node.js, the application must be run with --expose-gc .
    
    refs #2660
    warner committed May 21, 2021
    Configuration menu
    Copy the full SHA
    d4bc617 View commit details
    Browse the repository at this point in the history