Skip to content

Improved cross-platform and use CMake for project generation - #4

Open
talaviram wants to merge 15 commits into
GhostNoteAudio:masterfrom
soundradix:master
Open

Improved cross-platform and use CMake for project generation#4
talaviram wants to merge 15 commits into
GhostNoteAudio:masterfrom
soundradix:master

Conversation

@talaviram

Copy link
Copy Markdown

Tested on macOS (Xcode generator) and Windows (VS2022)

@CrushedPixel

Copy link
Copy Markdown

+1 for this PR - doesn't build on macOS without it due to strcpy_s missing

luqui and others added 4 commits March 13, 2026 08:34
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)
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.

3 participants