Memory Foundation Update#5
Merged
Merged
Conversation
Added the incomplete ThreadingEngine class and its corresponding source file; Removed the obsolete src/process/program/runtime.cpp and update src/process/CMakeLists.txt to use thread_engine.cpp instead of runtime.cpp; Incomplete class implementation
Introduce MemoryCore skeleton, implementation details remain incomplete and will be implemented in a follow-up.
Renamed the previous ThreadingEngine class to ThreadingCore and updated file name; All relevant references updated
Resources being studied for the implementation of a process-wide fixed-size memory block pool.
Added skeletons for process-wide MemoryPoolConfig and ProcessMemoryPool. Both are incomplete stubs; Update src/process/CMakeLists.txt to include the new source files
Prematurely adding necessary header dependency
Appended a comment block to dev_exe.cpp about potential debug-mode bad-address/sentinel values (several hex patterns and their decimal equivalents)
Annotate MemoryPoolConfig structure with CHEVRON_API to ensure proper symbol visibility from the shared library/object; Implementation remains incomplete
Added skeleton for strongly-typed DigitalSize template as a stub; Still incomplete
Moved digital size measurement facilities to 'include/chevron/common/units/digital' subdirectory; Implementation STILL INCOMPLETE
Add include/chevron/common/units/digital/unit_cast.hpp which introduces DigitalSizeCast, a constexpr template utility to convert between digital size unit types
Incomplete
Introduce a general units include header that centralizes unit-measure facilities; This front-facing header is still INCOMPLETE
Temporary 'size_t' references to be replaced with explicit unit types; Incomplete
Compile-time and runtime math utilities
Incomplete
Introduces an alignment and bit inspection header; Both headers incomplete
Adjustments to documentation comments
Introduce arithmetic and compound operators for DigitalSize; Moved class type traits above class definition
Replace raw size_t fields with unit-safe Bytes for block_size, chunk_size, and budget_ceiling in MemoryPoolConfig; Other fields and structure remain unchanged
Rolling example of application implementation with Chevron
Incomplete documentation
Added validation method stubs for process memory pool configuration; Incomplete implementation
Replaced placeholder TODO documentation with concrete descriptions for two memory types. chunk_descriptor.hpp now documents ChunkDescriptor as a non-copyable OS allocation tracker that records chunks acquired from the OS and enforces single-location residency within allocator tracking structures. region.hpp now documents MemoryRegion as a lightweight, freely copyable handle describing contiguous memory regions with no ownership semantics. These changes are documentation-only and clarify intent and ownership semantics in the headers.
Improved documentation in tagged_ptr.hpp. Describe TaggedPointer as an ABA-safe tagged pointer pairing a typed pointer with a monotonically increasing modification counter for lock-free CAS operations. No functional code changes.
Replaced placeholder TODO with detailed documentation for MemoryPoolConfig. Clarifies that the config defines how process memory is shaped, budgeted, and distributed to threads.
Updated details of ProcessMemoryAllocator class documentation
- Extend callable_signature in include/chevron/utility/function/type_traits.hpp to handle noexcept callables. Added specializations for non-const noexcept and const noexcept member functions, and for noexcept free functions. - Introduced IsNoexcept_t typedef (true_type/false_type) and IsNoexcept_v static constexpr for querying noexcept-ness, and adjusted existing specializations to expose IsNoexcept_t (and IsNoexcept_v where appropriate).
Update callable_signature specializations to expose boolean trait flags and a member-method type alias
Added general purpose void return signature verification concept
Add compile-time constraint to ScopeGuard's template parameter by including chevron/utility/function/concepts.hpp and using func::concepts::void_return_call for LambdaT.
Output short summary of target platform on configuration
Invoke target platform summary script on project configuration
Removed placeholder TODO documentation blocks from several memory and process/memory source files to clean up source file headings
Renamed the summary macro from output_host_summary to output_target_platform_summary and update its invocation in CMakeLists.txt
No need for this source file at the moment
Removed double-quotes from around flag names
Process-Level Memory Authority
Fixed stale file names being referenced after previously resolving conflicts across 'proc-memory' -> 'proc-threads' pull request
Fixes linker error encountered on certain build presets
Adjusted lock-free capability detection to be compatible across GCC and Clang, as well as compatibility across Clang versions
Adjusted lock-free detection method to use static checks on supporting members rather than runtime checks. 8-byte types should always be lock-free on modern hardware
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Process-Level Memory Infrastructure
Establishes the foundational layer of Chevron's hierarchical memory system. This introduces the process-wide memory pool (the root-level block dispenser that all downstream memory components will draw from) along with its supporting infrastructure for OS memory acquisition, chunk tracking, and thread-local caching.
The pool distributes fixed-size blocks through a lock-free embedded free list backed by ABA-safe 16-byte compare-and-swap, with platform-specific atomic intrinsics ensuring genuine lock-free behavior across all target platforms. Each thread maintains a local cache to mitigate contention on the shared free list, and an atomic expansion gate prevents redundant OS allocations when multiple threads exhaust the pool simultaneously.
Supporting types introduced here — memory descriptions, region handles, chunk descriptors, tagged pointers, the atomic free list, and the scope guard — are designed for reuse across the broader memory hierarchy as it develops.