-
Notifications
You must be signed in to change notification settings - Fork 349
audio: volume: Memory, blob, and fast_get allocs to module API #10323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR transitions the volume module to use the module API's automatic memory management system. By replacing manual memory allocation functions (rzalloc, rmalloc, rfree) with module API equivalents (mod_zalloc, mod_alloc), the code leverages automatic cleanup when the module unloads, eliminating the need for manual cleanup in error paths and the free function.
Key changes:
- Replaced manual memory allocation with module API allocation functions
- Removed manual memory deallocation from error paths and cleanup functions
- Removed the now-unused rtos/alloc.h include
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/audio/volume/volume_ipc4.c | Converted memory allocations to mod_alloc/mod_zalloc and removed manual cleanup calls |
| src/audio/volume/volume_ipc3.c | Converted memory allocations to mod_alloc/mod_zalloc and removed manual cleanup calls |
| src/audio/volume/volume.c | Removed manual rfree() calls from volume_free() function |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
SOFCI TEST |
Allocate all memory, blob handlers, and fast_get() buffers through module API mod_alloc() and friends. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
bd13751 to
3252247
Compare
|
This new version of volume module using module API to allocate resources still has all the resource freeing code in place. |
lgirdwood
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@softwarecki fyi - now keeps the free.
|
@lrudyX good to merge ? other CI looks good. |
softwarecki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping mod_free as-is, we have a plan to make tracking optional, so I don't see any blockers.
Allocate all memory, blob handlers, and fast_get() buffers through module API mod_alloc() and friends.