Repository navigation
Attribute dmvfs's own allocations via DMOD_CURRENT_ALLOCATOR - #55
Merged
Merged
Conversation
dmvfs.c hardcoded its own allocations to a literal "dmvfs" allocator name via a private DMVFS_ALLOCATOR_NAME macro, duplicating what DMOD_CURRENT_ALLOCATOR (see dmod's dmod_sal.h) now provides directly. Replace those Dmod_MallocEx(..., DMVFS_ALLOCATOR_NAME) call sites with the unified Dmod_Malloc(...) macro and drop the now-unused macro. dmvfs doesn't call dmod's create_library_makefile(), so also wire up dmod_set_current_allocator() directly for the dmvfs library target and both test executables, satisfying dmod_sal.h's new requirement that DMOD_CURRENT_ALLOCATOR be defined on the system side. Requires dmod's DMOD_CURRENT_ALLOCATOR system-side support (see choco-technologies/dmod#307).
1 of 2 tasks
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.
Summary
Companion PR to choco-technologies/dmod#307, which requires
DMOD_CURRENT_ALLOCATORto be defined on the system side too (it used to default toNULL/anonymous there).src/dmvfs.chardcoded a privateDMVFS_ALLOCATOR_NAME("dmvfs") string into everyDmod_MallocEx(..., DMVFS_ALLOCATOR_NAME)call for its own internal bookkeeping (mount table, path buffers, ...). Replaced all 9 call sites with the unifiedDmod_Malloc(...)macro and removed the now-unusedDMVFS_ALLOCATOR_NAMEdefinition frominc/dmvfs.h.dmvfsdoesn't call dmod'screate_library_makefile(), so addeddmod_set_current_allocator(dmvfs)directly inCMakeLists.txt, plus the same for both test executables intests/CMakeLists.txt.Depends on
This needs choco-technologies/dmod#307 and choco-technologies/dmfsi#18 merged first (dmvfs pulls in dmfsi, whose
DMOD_SYSTEMbuild also needed the same fix).Test plan
dmvfs(tests off) against local copies of the dmod (#307) and dmfsi (Add missing mutex protections to DMVFS functions #18) branches - compiles and links cleanly, withDMOD_CURRENT_ALLOCATOR="dmvfs"correctly attributed.🤖 Generated with Claude Code
https://claude.ai/code/session_01E7dx6Rd66adYqPjRLyE1GM
Generated by Claude Code