Skip to content

Conversation

@jacob-hughes
Copy link
Collaborator

This also uses more consistent terminology and hides the feature gating
of metrics behind a single API to make things more manageable.

Sorry, this is a large PR and it was difficult to split this one up any further.

This also uses more consistent terminology and hides the feature gating
of metrics behind a single API to make things more manageable.
run-make tests strike again, and this way we don't need put feature
gates everywhere we import `bdwgc`.
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
#[cfg(feature = "log-stats")]
GC_COUNTERS.allocated_boxed.fetch_add(1, atomic::Ordering::Relaxed);
bdwgc::metrics::increment(1, Metric::AllocationsBox);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we ever call increment with a value other than 1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do on the finalizer thread. It bunches up and returns the number of finalizers that were run.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, I see!

@ltratt ltratt added this pull request to the merge queue Jun 12, 2025
Merged via the queue into softdevteam:master with commit d7cd1a4 Jun 12, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants