cuiziweizw opened a new pull request, #18019:
URL: https://github.com/apache/nuttx/pull/18019
## Summary
This PR adds the `_LIBCPP_HAS_NO_CONTENTION_TABLE` macro definition to the
libcxx configuration file.
### Why this change is needed
By default, libcxx allocates a contention table for optimizing semaphore
operations under high contention scenarios. However, for memory-constrained
embedded systems like NuttX targets, this table consumes valuable RAM that
could be better used elsewhere.
### What this PR does
- Adds `#define _LIBCPP_HAS_NO_CONTENTION_TABLE` to
`libs/libxx/__config_site`
- This disables the contention table allocation in libcxx's semaphore
implementation
- Results in reduced RAM footprint without affecting basic semaphore
functionality
## Impact
- **Stability**: No impact - this is a standard libcxx configuration option
- **Compatibility**: No breaking changes - semaphores continue to work
correctly
- **RAM Savings**: Reduces memory footprint by eliminating the contention
table
- **Performance**: Minimal impact for typical embedded workloads with low
thread contention
## Testing
### Build Verification
- **Host**: Ubuntu Linux x86_64
- **Build System**: CMake/Make
The change was verified by confirming successful compilation with the new
configuration.
```bash
# Configure and build
<board>:<config>
make -j$(nproc)
# Build completed successfully without errors
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]