Repository navigation
feat: add Dmod_StrMerge function for merging multiple strings - #339
Merged
Merged
Conversation
- Add Dmod_StrMerge(count, ...) macro for module code (uses DMOD_CURRENT_ALLOCATOR) - Add Dmod_StrMergeEx(count, moduleName, ...) for explicit allocator naming - Implement _StrMerge and _StrMergeEx weak symbols in dmod_if_str.c - Add comprehensive unit tests for the new function - Include tests in CMakeLists.txt
JaxCalder
force-pushed
the
copilot/add-str-merge-function
branch
from
October 24, 2026 16:24
2c4e522 to
df1adb1
Compare
added 2 commits
October 24, 2026 16:31
Since DMOD_CURRENT_ALLOCATOR is always defined (for both modules and system code), Dmod_StrMerge can be a pure macro that always calls Dmod_StrMergeEx with the correct allocator. The weak symbol _StrMerge was incorrect as it would allocate under the wrong module name.
Keep the original #if defined(DMOD_MODULE_NAME) pattern for Dmod_StrDup to maintain backward compatibility with older module code.
JohnAmadis
approved these changes
Oct 24, 2026
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
Added function that allows merging multiple strings into a single newly allocated string.
Changes
API
Dmod_StrMerge (for modules)
Dmod_StrMergeEx (with explicit allocator)
Implementation details