Skip to content

Conversation

Hennzau
Copy link

@Hennzau Hennzau commented Sep 17, 2025

hi, I don't really know why the public API did not provide those functions before so I added them.

Please tell me if I'm wrong and we can't do that like that

Copy link
Contributor

@sgued sgued left a comment

Choose a reason for hiding this comment

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

What's the purpose of having just this API?

I think it would need to also have the other methods that allow for manipulating the count manually such as as_ptr and from_raw.

src/pool/arc.rs Outdated

/// Returns the number of strong (`Arc`) pointers to this allocation
pub fn strong_count(this: &Self) -> usize {
this.inner().strong.load(Ordering::SeqCst)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why SeqCst and not Relaxed ? This is a public API that has no use besides hinting.

@Hennzau
Copy link
Author

Hennzau commented Sep 17, 2025

What's the purpose of having just this API?

I think it would need to also have the other methods that allow for manipulating the count manually such as as_ptr and from_raw.

Yeah you're right I will add those methods then! (FYI, I needed these methods, this is why I forked, but indeed it's not complete)

@Hennzau Hennzau marked this pull request as draft September 17, 2025 14:04
@Hennzau Hennzau changed the title feat: Arc strong_count and get_mut public functions feat: Arc and get_mut public method Sep 17, 2025
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