use memory aligned allocations, fix bug in FFT magnitude (integer path)#5499
use memory aligned allocations, fix bug in FFT magnitude (integer path)#5499
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR refactors FFT buffer allocation in the audio reactive module to use Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@usermods/audioreactive/audio_reactive.cpp`:
- Around line 299-309: The code is shadowing the file-scope pointers valFFT and
windowFFT by declaring new local float* variables when calling
heap_caps_aligned_calloc, leaving the globals nullptr and causing FFTcode() to
crash or leak; change the allocations to assign directly to the existing globals
(valFFT = (float*)heap_caps_aligned_calloc(...), windowFFT =
(float*)heap_caps_aligned_calloc(...)), keep the null checks as is, and ensure
on failure you call heap_caps_free(valFFT) only if the global valFFT was
actually set and then set the globals to nullptr; reference functions/variables:
valFFT, windowFFT, FFTcode(), heap_caps_aligned_calloc, heap_caps_free.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 436b027f-1316-4c26-b76b-49a6b327b035
📒 Files selected for processing (1)
usermods/audioreactive/audio_reactive.cpp
Summary by CodeRabbit
Bug Fixes
Performance