Skip to content

Set DMOD_CURRENT_ALLOCATOR for the dmosi_proc library and its tests - #10

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

JohnAmadis merged 1 commit into
mainfrom
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/dmosi_proc.c already attributes per-process allocations to the 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 added dmod_set_current_allocator(dmosi_proc) directly in CMakeLists.txt, plus the same for the test executable in tests/CMakeLists.txt.

Depends on

This needs choco-technologies/dmod#307 merged first.

Test plan

  • Built 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.
  • CI build.

🤖 Generated with Claude Code

https://claude.ai/code/session_01E7dx6Rd66adYqPjRLyE1GM


Generated by Claude Code

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).
@JohnAmadis
JohnAmadis merged commit 064923c into main Sep 19, 2026
2 of 4 checks passed
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.
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