-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Description
Describe the bug
The current Zephyr C++ new implementation allocates memory from the kernel heap instead of using the same heap used by malloc.
In case a system would be configured with none, or a small, kernel heap and a large libc heap the call to new will fail even when sufficient memory is available in the libc heap.
To Reproduce
Steps to reproduce the behavior:
- Problem was hit on private project.
- Todo: reproduce with libcxx tests
Expected behavior
new/delete should use same memory pool as malloc/free
Impact
None useable system due to memory allocation failure.
Environment
- OS: Linux
- Toolchain: Zephyr
- f9c94d4 (2.0-rc3)
Additional context
PR (#18464) was created to provide the option to disable Zephyr new/free implementation and falback to libcxx implementation which uses malloc and free internally.
One open question from the code review on PR #18464 is why zephyr provides its own implementation of new/free that specifically depends on kernel heap