Improved cross-platform and use CMake for project generation - #4
Open
talaviram wants to merge 15 commits into
Open
Improved cross-platform and use CMake for project generation#4talaviram wants to merge 15 commits into
talaviram wants to merge 15 commits into
Conversation
|
+1 for this PR - doesn't build on macOS without it due to |
Replaced manual zeroing of buffer with memset for efficiency. Fixes soundradix/Radical1#1740
Generate fills its vectors with push_back from empty, so the number of reallocations is decided by the standard library's growth factor rather than by the work: 1.5x on the MSVC STL against 2x on libc++ and libstdc++, which is roughly 1.7x more allocations for an identical result. That shows up on the audio thread. SetParameter -> UpdateLines calls Generate on every decay, size or modulation change, and each call builds three of these vectors, so a host automating a reverb parameter pays 33 allocations per call on Windows against 21 elsewhere. The count is known before the loop starts, so reserve it. One allocation per vector on every platform, and the platform difference goes away. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The unqualified name is not declared in this translation unit. MSVC's headers happen to drag ::size_t in transitively so it built there, but libstdc++ does not, and GCC 13 rejects it: RandomBuffer.cpp:33:33: error: 'size_t' was not declared in this scope; did you mean 'std::size_t'? Say std::size_t and include <cstddef> for it, rather than relying on whatever <vector> pulls in. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Qualify size_t in RandomBuffer::Generate (fixes GCC build)
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.
Tested on macOS (Xcode generator) and Windows (VS2022)