Repository navigation
Define DMOD_CURRENT_ALLOCATOR when building in DMOD_SYSTEM mode - #18
Merged
Merged
Conversation
dmfsi's DMOD_SYSTEM branch (both the library itself and the ramfs example) builds as a plain static library with no DMOD_MODULE_NAME compile definition - that's only set by dmod_add_library() in the DMOD_MODULE branch. dmod_sal.h's Dmod_Malloc/Dmod_Free/... (already used as-is by dmfsi.h's inline helpers and ramfs.c) now require DMOD_CURRENT_ALLOCATOR to be defined explicitly on that side, so wire up dmod's dmod_set_current_allocator() helper for both targets. 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).dmfsi.h's inline helpers (dmfsi_strndup,dmfsi_path_create,dmfsi_path_free) andexamples/ramfs/ramfs.calready call the unifiedDmod_Malloc/Dmod_Freemacros, so no source changes were needed there. The gap is in theDMOD_SYSTEMbuild branch ofCMakeLists.txt(bothdmfsiitself and theramfsexample): unlike theDMOD_MODULEbranch (which goes throughdmod_add_library()and getsDMOD_MODULE_NAMEas a compile definition automatically), theDMOD_SYSTEMbranch is a plainadd_library()with no such definition - sodmod_sal.hnow requiresDMOD_CURRENT_ALLOCATORto be set explicitly there.dmod_set_current_allocator(dmfsi)to theDMOD_SYSTEMbranch of the mainCMakeLists.txt.examples/ramfs/CMakeLists.txt'sDMOD_SYSTEMbranch.Depends on
This needs choco-technologies/dmod#307 merged first.
Test plan
dmfsi(DMOD_SYSTEMmode) as a dependency ofdmvfs, against a local copy of the dmod branch from PR #307 - compiles and links cleanly.🤖 Generated with Claude Code
https://claude.ai/code/session_01E7dx6Rd66adYqPjRLyE1GM
Generated by Claude Code