diff --git a/.github/workflows/api-check.yml b/.github/workflows/api-check.yml index 57f1497c23..eeae0f9738 100644 --- a/.github/workflows/api-check.yml +++ b/.github/workflows/api-check.yml @@ -22,7 +22,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: # We need nightly for cargo-public-api to get the API output. - toolchain: nightly + toolchain: nightly-2023-01-04 profile: minimal # It is not necessary to use nightly as default (which is used to install cargo-public-api and compile our code). # However, our current toolchain is 1.59.0, and cargo-public-api requires 1.60 at least. To make it simple, @@ -32,6 +32,6 @@ jobs: # Install cargo-public-api - name: Install cargo-public-api - run: cargo install cargo-public-api + run: cargo install cargo-public-api --version 0.26.0 - name: API Diff - run: cargo public-api --diff-git-checkouts origin/${GITHUB_BASE_REF} ${{ github.event.pull_request.head.sha }} --deny=all + run: cargo public-api diff origin/${GITHUB_BASE_REF}..${{ github.event.pull_request.head.sha }} --deny=all diff --git a/src/plan/generational/global.rs b/src/plan/generational/global.rs index ba0fe4b6df..4292ce9640 100644 --- a/src/plan/generational/global.rs +++ b/src/plan/generational/global.rs @@ -149,7 +149,7 @@ impl Gen { pub fn requires_full_heap_collection(&self, plan: &P) -> bool { // Allow the same 'true' block for if-else. // The conditions are complex, and it is easier to read if we put them to separate if blocks. - #[allow(clippy::if_same_then_else)] + #[allow(clippy::if_same_then_else, clippy::needless_bool)] let is_full_heap = if crate::plan::generational::FULL_NURSERY_GC { // For barrier overhead measurements, we always do full gc in nursery collections. true @@ -175,7 +175,12 @@ impl Gen { } else if self.virtual_memory_exhausted(plan) { true } else { - plan.get_total_pages() <= plan.get_reserved_pages() + // We use an Appel-style nursery. The default GC (even for a "heap-full" collection) + // for generational GCs should be a nursery GC. A full-heap GC should only happen if + // there is not enough memory available for allocating into the nursery (i.e. the + // available pages in the nursery are less than the minimum nursery pages), if the + // virtual memory has been exhausted, or if it is an emergency GC. + false }; self.gc_full_heap.store(is_full_heap, Ordering::SeqCst);