cpp: Use malloc/free instead of kernel variants in new/delete

Use malloc/free instead of k_malloc/k_free in operator new/delete
implementation or use libstdc++ implementation when available.

Further updated cpp_synchronization sample to enable minimal libc heap
as virtual destructor requires operator delete which depends on free.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
This commit is contained in:
Jan Van Winkel 2019-11-14 00:23:33 +01:00 committed by David Leach
commit 8a98a67bf1
7 changed files with 11 additions and 104 deletions

View file

@ -2,6 +2,5 @@ CONFIG_NEWLIB_LIBC=y
CONFIG_CPLUSPLUS=y
CONFIG_LIB_CPLUSPLUS=y
CONFIG_STD_CPP17=y
CONFIG_HEAP_MEM_POOL_SIZE=1024
CONFIG_ZTEST=y
CONFIG_ZTEST_STACKSIZE=2048

View file

@ -4,12 +4,6 @@ tests:
platform_exclude: qemu_x86_coverage
min_flash: 54
tags: cpp
misc.app_dev.libcxx.zephyr_cpp:
arch_exclude: posix
platform_exclude: qemu_x86_coverage
tags: cpp
extra_configs:
- CONFIG_ZEPHYR_CPLUSPLUS=y
misc.app_dev.libcxx.exceptions:
arch_exclude: posix
platform_exclude: qemu_x86_coverage