Skip to content

Conversation

@jsarha
Copy link
Contributor

@jsarha jsarha commented Sep 10, 2025

No description provided.

Jyri Sarha added 30 commits September 12, 2025 16:13
Add rmalloc_align() function. The alignment is present in all alloc
implementations used by rmalloc() so there is no reason not to provide
it in the API.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Prepare cmocka tests for rmalloc() and rmalloc_align().

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Prepare for rmalloc_align() usage.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Forward mod_alloc() calls to rmalloc() instead of rbmalloc(). rballoc()
calls are forwarded to virtual heap if it is enabled, but rmalloc()
calls are not. The commit also removes if (alignment) condition, as
rmalloc() will eventually end up to rmalloc_align() with zero alignment.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Remove the remains of function name from the prints and in case of
heap allocation failure, print all available related parameters.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Print all module IDs hex for better readability.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Enabling this option will cause mod_alloc_align() to use
rballoc_aling() instead of rmalloc_align(). The significant difference
between these functions is that rballoc uses virtual heap if its
enabled, rmalloc does not.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Change mod_alloc_align and friends size and alignment parameters type
to size_t.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory through module API mod_alloc() and friends
and remove all redundant rfree() calls from module unload
functions and init error branches.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory through module API mod_alloc() and friends
and remove all redundant rfree() calls from module unload
functions and init error branches.

NOTE: copier_dai.c and copier_host.c still have their shared memory
allocated through the old API. This is to be fixed once we have
decided on how the shared memory allocations should work in
user-space.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
The code within #if CONFIG_HOST_DMA_STREAM_SYNCHRONIZATION should free
host_common resources in case of failure. The commit fixes the issue.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory through module API mod_alloc() and friends
and remove all redundant rfree() calls from module unload
functions and init error branches.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

The change does not touch the google_ctc_audio_processing.h API or its
mock implementation, that still uses rballoc() and rfree().

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

The change does not touch the google_rtc_audio_processing.h API or its
mock implementation, that still uses rballoc() and rfree().

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Make mod_alloc() versions of all heap using functions. The new functions
are simple copy-paste versions of the original, just using mod_alloc()
and friend instead of rmalloc() friends.

The idea is to get rid off the original versions once all the modules
are converted to module API heap usage and the cmocka math tests have
been fixed to work with mod_alloc() versions.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Add mocks for mod_alloc(), mod_zalloc(), and mod_free(). These dummy
versions do not keep track of the allocated memory. They just forward
the calls to reqular malloc() and free().

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Convert auditory, dct, fft, and matrix math tests to use module heap
API functions instead of the old version using rmalloc() and friends
directly.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Both unit tests and modules should now use the module API heap
allocation functions, so we can now remove the directly heap using
versions.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

However, the rtnr_stub's heap access, rtk_alloc() and rtk_free() still
use heap directly like before.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Jyri Sarha added 17 commits September 12, 2025 16:42
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

The IPC3 implementation of selector uses the component interface
directly and can not use the new module API.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Allocate all memory, blob handlers, and fast_get() buffers through
module API mod_alloc() and friends and remove all redundant rfree(),
comp_data_blob_handler_free(), and fast_put() calls from module unload
functions and init error branches.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Add mod_psy_free_mel_filterbank() for freeing the allocated memory.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Fix memory leaks from auditory cmocka test.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Fix all memory leaks found from fft test when tests were run under
Valgrind.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Fix all memory leaks found from matrix test when tests were run under
Valgrind.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Add mod_dct_free_16() to free memory allocated by mod_dct_initialize_16().

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Fix memory leaks found by running the tests with Valgrind.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Fix memory freeing error from module_adapter_test_free(). Use
free_test_source() for sources, not free_test_sink().

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Fix all memory leaks found from volume test when tests were run under
Valgrind.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Fix all memory leaks found from mux_copy test when tests were run under
Valgrind.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Fix all memory leaks found from demux_copy test when tests were run under
Valgrind.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Fix all memory leaks found from all pipeline tests when tests were run
under Valgrind.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
@jsarha jsarha force-pushed the module_api_rest_of_the_modules_no_vheap branch from b69bf96 to 65b1e8b Compare September 12, 2025 13:42
@jsarha jsarha closed this Sep 12, 2025
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