-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Background
This project currently uses reference counting for memory management, primarily for CPython compatibility. To enable more aggressive memory compaction, we want to introduce a new macro to switch to RAII-mode memory management when desired.
Requirements
- RAII Mode Activation:
- Only enabled when
-DRAII_MODE=ONis set via CMake option.
- Only enabled when
- Macro Implementation:
- Add a new macro to enable RAII-based memory management.
- Use macro guards, but minimize their usage scope to only where necessary.
- Code Quality:
- Write clean, expert-level C++ code.
- Minimal code changes: Only modify/refactor code directly impacted by the new macro.
- Documentation Review:
- Read all documentation in the
docs/folder to fully understand existing design and constraints before implementation. See the references below for a complete list of documents.
- Read all documentation in the
- Compatibility:
- When RAII is not enabled, retain the current reference counting approach for CPython compatibility.
- Goal:
- Allow move-aggressive memory compaction when RAII is available, with minimal disruption to current functionality.
Acceptance Criteria
- New macro is added and properly guarded.
- CMake option
-DRAII_MODE=ONswitches the project to RAII mode. - Only minimal code changes are made to enable RAII.
- Code quality meets expert C++ developer standards.
- Documentation is reviewed prior to implementation.
References:
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request