libs/libxx: Add _LIBCPP_HAS_NO_CONTENTION_TABLE to reduce RAM usage

When _LIBCPP_HAS_NO_CONTENTION_TABLE is defined, libcxx will not
allocate the contention table used for semaphore implementation,
which can save significant RAM on memory-constrained embedded systems.

This optimization is particularly useful for NuttX targets where
every byte of RAM matters.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
This commit is contained in:
cuiziwei
2026-01-19 20:58:11 +08:00
committed by archer
parent f0cb80d297
commit 6a51857e90
+1
View File
@@ -27,6 +27,7 @@
/* #undef _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION */
/* #undef _LIBCPP_HAS_NO_FILESYSTEM */
/* #undef _LIBCPP_HAS_NO_RANDOM_DEVICE */
#define _LIBCPP_HAS_NO_CONTENTION_TABLE
#if defined(CONFIG_CXX_NO_LOCALIZATION)
# define _LIBCPP_HAS_NO_LOCALIZATION
#elif defined(CONFIG_CXX_MINI_LOCALIZATION)