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

Switch to an atomic counter for DeviceMemory allocations #2033

Merged
merged 3 commits into from
Oct 10, 2022

Conversation

marc0246
Copy link
Contributor

@marc0246 marc0246 commented Oct 9, 2022

This replaces the Mutex<u32> that was used to keep track of the allocation count for validation with an AtomicU32. The purpose is that this atomic is going to give us wait-free reads of the value, which I would like to use in #1997. I've also made the count public if a user would like to write their own allocator and use the value for heuristics much the way the library is going to.

Changelog:

### Additions
- Added `Device::allocation_count`.

@marc0246 marc0246 changed the title Add atomic counter for DeviceMemory allocations Switch to an atomic counter for DeviceMemory allocations Oct 10, 2022
@Rua Rua merged commit c8b611a into vulkano-rs:master Oct 10, 2022
@marc0246 marc0246 deleted the allocation-count branch October 10, 2022 14:34
Rua added a commit that referenced this pull request Oct 10, 2022
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