Nyxus persistent heap engine
cdk-rsx-engine-nyxus implements Nyxus, the persistent heap engine. It owns the
explicit Nyxus allocator, initialization and reopening, and the recursive
NyxusData trait/derive. Ordinary Rust Global allocations remain transient.
Its container facades live in
cdk_rsx_collections::nyxus; the shared module tree lives in cdk-rsx-store.
Nyxus is the default for a Memory declaration and its complete Data record.
The allocator uses Platform's actual shared Heap algorithm and explicit pinned
page provider. It owns bootstrap+64..80 and bootstrap+256..4096. Unsafe reopen
requires complete platform/allocator ABI admission before interpreting private
Heap metadata; matching magic or compiler identity alone is insufficient.
contains checks page-domain membership, not object liveness or access rights.
allocator_layout_types() supplies the actual HintedHeap (three slab-origin
rows and two page-bin rows), Slab and PageHeader
physical roots. All three participate in certification, including exhausted
page headers recovered by address arithmetic. ALLOCATOR_POLICY: [u8;32] is
computed on the build host from the allocator/data/derive and complete Platform
provider/Heap/priority sources. Stored domain/band bytes route release and resize
independently of the current context. Compose the policy with the compiler/physical/semantic contracts;
source text and source hashing are absent from the running canister.
The whitelist rejects transient containers, references, callbacks, raw pointers,
trait objects and ordinary interior-mutable cells. Exact-version
ic_principal::Principal 0.1.5 is an explicitly reviewed inline scalar. A
NyxusData implementation is not itself a physical ABI certificate.
The proof also requires a nonrecursive __NYXUS_POLICY for its own
interpretation. Derives hash the selected declaration. Opaque infrastructure
implementations supply a complete production-source/helper recipe and concrete
encoded generic contracts where applicable. Native policies are collected from
the compiled physical graph; recursive Rc<Self> does not recursively evaluate
policy constants. An incidental Codec implementation is not a native policy
dependency. Retained encoded records separately seed their codec closure.
Custom comparator,
Drop, serializer and saved-byte semantics remain frozen-owner inputs. Policies
compose during root admission, independently of ordinary physical bind checks.
Native allocations use pinned System page runs. Native byte-image copying does not serialize/rebase these raw pointers. This crate selects no all-retained Global allocator and introduces no allocation-mode switch.
Platform owns the shared Heap implementation. See runtime memory for allocation behavior, conventions for application authoring and upgrades for admission and conversion.
License
This crate is available under the ICP3V License.