A C++ data-oriented registry with compile-time type mapping and cache-efficient handle-based storage. Originally designed as the data layer of a compiler architecture, this system is general-purpose and can be used in other data-oriented systems.
The underlying storage system is built around a hybrid stack/heap strategy.
Each SmartStorage<T, N> is statically evaluated at compile time:
This allows predictable performance for small datasets while maintaining scalability for larger ones.
using NodeDataRegistryTable = LinearTable<
Entry<NodeInstruction, InstructionNodeData>,
Entry<NodeCallFunction, FunctionCallNodeData>,
Entry<NodeDeclarationFunction, FunctionDeclarationNodeData>,
Entry<NodeLiteral, LiteralNodeData>,
Entry<NodeOperation, OperationNodeData>
>;
using NodeDataRegistry = MultiStorageRegistry<NodeDataRegistryTable, NodeHandleProvider, 1 << 20>;
NodeDataRegistry registry(provider);
The MultiStorageRegistry<Table, Handle, N> is a facade that aggregates multiple data domains, driven by a compile-time configuration table, into a unified internal allocation system built on top of SmartStorage<T, N> previously introduced. Additionally, it is possible to define a specific size for MultiStorageRegistry<..., N> in bytes, which is then evenly distributed across the underlying storage subsystems.
registry.construct(nodeLiteral, token);
auto& literalData = registry.get(nodeLiteral);
registry.construct_for<LiteralNodeData>(nodeLiteral, token);
registry.construct(nodeOperation, lhs, rhs);
auto& operationData = registry.get(nodeOperation);
registry.reset();
This project is licensed under the Boost Software License. See the LICENSE file for details.
© Félix-Olivier Dumas 2026