Skip to content

Attribute dmvfs's own allocations via DMOD_CURRENT_ALLOCATOR - #55

Merged
JohnAmadis merged 1 commit into
developfrom
claude/epic-hopper-jck8tq
Sep 19, 2026
Merged

JohnAmadis merged 1 commit into
developfrom
claude/epic-hopper-jck8tq

Conversation

@JohnAmadis

Copy link
Copy Markdown
Contributor

Summary

Companion PR to choco-technologies/dmod#307, which requires DMOD_CURRENT_ALLOCATOR to be defined on the system side too (it used to default to NULL/anonymous there).

  • src/dmvfs.c hardcoded a private DMVFS_ALLOCATOR_NAME ("dmvfs") string into every Dmod_MallocEx(..., DMVFS_ALLOCATOR_NAME) call for its own internal bookkeeping (mount table, path buffers, ...). Replaced all 9 call sites with the unified Dmod_Malloc(...) macro and removed the now-unused DMVFS_ALLOCATOR_NAME definition from inc/dmvfs.h.
  • dmvfs doesn't call dmod's create_library_makefile(), so added dmod_set_current_allocator(dmvfs) directly in CMakeLists.txt, plus the same for both test executables in tests/CMakeLists.txt.

Depends on

This needs choco-technologies/dmod#307 and choco-technologies/dmfsi#18 merged first (dmvfs pulls in dmfsi, whose DMOD_SYSTEM build also needed the same fix).

Test plan

🤖 Generated with Claude Code

https://claude.ai/code/session_01E7dx6Rd66adYqPjRLyE1GM


Generated by Claude Code

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).
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