Repository navigation
Set DMOD_CURRENT_ALLOCATOR for the dmosi_proc library and its tests - #10
Merged
Merged
Conversation
dmosi_proc.c already attributes per-process allocations to their caller-supplied process->module_name, and its one self-allocation (a scratch thread-handle buffer) already uses the plain Dmod_Malloc macro - no source changes needed. dmosi-proc builds via a raw add_library(), not dmod's create_library_makefile(), so dmod_sal.h's new requirement that DMOD_CURRENT_ALLOCATOR be defined on the system side needs to be satisfied directly: added dmod_set_current_allocator() for the dmosi_proc library target and its test executable. Requires dmod's DMOD_CURRENT_ALLOCATOR system-side support (see choco-technologies/dmod#307).
This was referenced Sep 19, 2026
JohnAmadis
pushed a commit
to choco-technologies/dmosi-posix
that referenced
this pull request
Sep 19, 2026
lib/dmosi-proc was still pinned to a commit that predates choco-technologies/dmosi-proc#10, so CI (which actually checks out submodules, unlike a quick local build without --init) compiled the old dmosi_proc.c, which calls the now-unified Dmod_Malloc without DMOD_CURRENT_ALLOCATOR defined for that target - hitting the same #error this whole change chain is about. Point it at dmosi-proc's own fix commit directly; no release/publish step needed since this is a plain git submodule pointer, not a dmf-get artifact. Verified: full CMake build of dmosi_posix against the now-merged dmod (develop) and this submodule commit compiles and links cleanly.
JohnAmadis
pushed a commit
to choco-technologies/dmosi-freertos
that referenced
this pull request
Sep 19, 2026
config/FreeRTOSConfig.h pulls in dmod_sal.h, so the FreeRTOS-Kernel submodule's own targets (freertos_kernel, freertos_kernel_port) also need DMOD_CURRENT_ALLOCATOR defined now, even though they don't call Dmod_Malloc themselves - the #error in dmod_sal.h fires on inclusion. Since those targets are defined by the third-party submodule itself (not something dmod_set_current_allocator() can be called on directly), set the definition on them directly via target_compile_definitions() right after add_subdirectory(lib/freertos) - deliberately not through the freertos_config INTERFACE library, since that would also propagate into dmosi_freertos's own compilation (which already sets its own, different DMOD_CURRENT_ALLOCATOR value) and collide under -Werror. Also bump the vendored lib/dmosi-proc submodule to its own DMOD_CURRENT_ALLOCATOR fix (choco-technologies/dmosi-proc#10) - it was still pinned to a commit that predates it, so CI (which actually checks out submodules) was compiling the old dmosi_proc.c and hitting the same #error. Verified: full CMake build (dmosi_freertos + freertos_kernel with the GCC_POSIX port + dmosi_proc) against the now-merged dmod (develop) compiles and links cleanly with no errors.
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/dmosi_proc.calready attributes per-process allocations to the caller-suppliedprocess->module_name, and its one self-allocation (a scratch thread-handle buffer) already uses the plainDmod_Mallocmacro - no source changes needed.dmosi_procbuilds via a rawadd_library(), not dmod'screate_library_makefile(), so addeddmod_set_current_allocator(dmosi_proc)directly inCMakeLists.txt, plus the same for the test executable intests/CMakeLists.txt.Depends on
This needs choco-technologies/dmod#307 merged first.
Test plan
dmosi_proc+ its test against a local copy of the dmod branch from PR #307 - compiles and links cleanly,DMOD_CURRENT_ALLOCATOR="dmosi_proc"correctly attributed.🤖 Generated with Claude Code
https://claude.ai/code/session_01E7dx6Rd66adYqPjRLyE1GM
Generated by Claude Code