-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Don't call lib_free in the kernel code #10066
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
since kernel just allocate memory from kmm_malloc Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
73d9235 to
af52d9e
Compare
|
Speaking of which:
there is a use of plain malloc/free. They might be other few spots where it happens, e.g not using indirection. I think in minicxx operator new/delete should also use on lib_*. Maybe would have been easier to make |
@acassis esp use the wrong function.
No, minicxx doesn't need call lib_* since cxx is only allowed to be used in userspace.
Only components which are compiled and used by both kernel and usespace(e.g. libc/libkc, libmm/libkmm) need call lib_xxx. |
|
There are many places like it. I have changes stashed somewhere and will push change for review soon |
|
Could you consider below issue:
The assertion happened in The cause of this assertion is that the memory to be freeed by In libc building, Under the circumstance of #8974 is trying to fix this issue. This PR is acturally revert that fix. |
|
Besides |
|
Ok, CONFIG_ESP32_SPIRAM_USER_HEAP is a verry new option, @acassis @gustavonihei could you take a look. |
@xiaoxiang781216 the need for library functions inside the kernel has been discussed previously here: https://github.com/apache/nuttx/pull/8974/files#r1159313382 |
|
OK, look like my patch is wrong. @pkarashchenko could you revert my change in your PR. |
Here it is #10110, but I have some limited availability to test it well and would appreciate support in verification part |
Summary
since kernel just allocate memory from kmm_malloc
Impact
code refactor only since lib_free call kmm_free when is compiled in kernel spacee
Testing
ci