Skip to content

Restore ResetAndPrewarm as a deprecated shim#292

Merged
sdatkinson merged 2 commits into
mainfrom
reset-and-prewarm-shim
Jun 17, 2026
Merged

Restore ResetAndPrewarm as a deprecated shim#292
sdatkinson merged 2 commits into
mainfrom
reset-and-prewarm-shim

Conversation

@sdatkinson

Copy link
Copy Markdown
Owner

Summary

Adds a temporary DSP::ResetAndPrewarm() compatibility shim on top of the new Reset() prewarm controls.

Reset() now prewarms by default and can be controlled with SetPrewarmOnReset(). This PR restores the old explicit ResetAndPrewarm() API as a deprecated helper so downstream callers have a migration path before removal in v0.6.0.

Changes

  • Adds DSP::ResetAndPrewarm(sampleRate, maxBufferSize).
  • Implements it by temporarily forcing prewarmOnReset = true, calling Reset(), then restoring the previous setting.
  • Uses RAII so the previous setting is restored if Reset() throws.
  • Adds tests for:
    • forcing prewarm when PrewarmOnReset is disabled
    • restoring the previous setting on exception

Testing

cmake --build build --target run_tests -j4
./build/tools/run_tests

@sdatkinson sdatkinson changed the title Reset and prewarm shim Restore ResetAndPrewarm as a deprecated shim Jun 17, 2026
@sdatkinson sdatkinson merged commit 6e32dca into main Jun 17, 2026
4 checks passed
@sdatkinson sdatkinson deleted the reset-and-prewarm-shim branch June 17, 2026 15:35
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.

1 participant