[vulkan] remove unused allocator release overload#9238
Open
johningve wants to merge 1 commit into
Open
Conversation
The Vulkan allocator as well as the region and block allocators all had a `int release(void *user_context)` overload in addition to the regular `int release(void *user_context, MemoryRegion *region)`. The single-argument overload is unused, and it is bug prone. It is easy to call the single-argument overload instead of the correct two-argument overload by forgetting to fill the user_context argument. This may not produce any compiler error because a pointer to a MemoryRegion converts implicitly to a `void *`. Since the overload is unused, this commit removes it from the three allocator classes. Also in the block allocator, a private helper `release_block_entry` is also removed. Its only reference was the single-argument `release`.
alexreinking
approved these changes
Jul 24, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9238 +/- ##
==========================================
+ Coverage 70.24% 70.33% +0.09%
==========================================
Files 255 255
Lines 78929 78904 -25
Branches 18879 18866 -13
==========================================
+ Hits 55444 55498 +54
+ Misses 17872 17857 -15
+ Partials 5613 5549 -64 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Vulkan allocator as well as the region and block allocators all had a
int release(void *user_context)overload in addition to the regularint release(void *user_context, MemoryRegion *region). The single-argument overload is unused, and it is bug prone. It is easy to call the single-argument overload instead of the correct two-argument overload by forgetting to fill the user_context argument. This may not produce any compiler error because a pointer to a MemoryRegion converts implicitly to a void *.Since the overload is unused, this commit removes it from the three allocator classes. Also in the block allocator, a private helper
release_block_entryis also removed. Its only reference was the single-argumentrelease.Checklist