WIP: Share allocation within caller-owned memory regions #2

Closed
erikinkinen wants to merge 4 commits from feature/posix-compat into main
Owner

Summary and rationale

Share allocation within caller-supplied memory and resize live allocations in
place when adjacent space permits. Shrinking returns the tail to the same free
list; moving first obtains replacement storage and preserves the payload prefix.

Tracking and scope

Implements the shared allocator
and resizing for
native build tools.
Includes the primitive, serialized GlobalAlloc adapter, regression controls,
documentation and CI. Consumer rebuilds and image acceptance remain open.

Architecture, authority and failure behavior

The caller supplies one writable region and retains its backing through every
allocation. Resizing acquires no mapping, service or replacement arena. The exact
live pointer and layout remain unsafe caller obligations. Refused growth leaves
the allocation intact; a drained count does not retire the underlying mapping.

Review checklist

  • Signed ISC source, documented unsafe contracts and missing_docs enforcement
  • Actual Cargo target/Rustdoc inventory, complete source-size gate and formatting for 494312f3
  • Current strict Clippy, unit matrix and CI for the resizing change
  • Matching native consumers, allocator probes and image acceptance
## Summary and rationale Share allocation within caller-supplied memory and resize live allocations in place when adjacent space permits. Shrinking returns the tail to the same free list; moving first obtains replacement storage and preserves the payload prefix. ## Tracking and scope Implements the [shared allocator](https://git.erikinkinen.fi/erix/lib-owned-region/issues/1) and [resizing](https://git.erikinkinen.fi/erix/lib-owned-region/issues/3) for [native build tools](https://git.erikinkinen.fi/erix/integration/issues/8). Includes the primitive, serialized GlobalAlloc adapter, regression controls, documentation and CI. Consumer rebuilds and image acceptance remain open. ## Architecture, authority and failure behavior The caller supplies one writable region and retains its backing through every allocation. Resizing acquires no mapping, service or replacement arena. The exact live pointer and layout remain unsafe caller obligations. Refused growth leaves the allocation intact; a drained count does not retire the underlying mapping. ## Review checklist - [x] Signed ISC source, documented unsafe contracts and missing_docs enforcement - [x] Actual Cargo target/Rustdoc inventory, complete source-size gate and formatting for 494312f3 - [x] Current strict Clippy, unit matrix and CI for the resizing change - [ ] Matching native consumers, allocator probes and image acceptance
feat: Share allocation within caller-owned regions
All checks were successful
CI / markdown (push) Successful in 9s
CI / rust (push) Successful in 40s
CI / rust (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
b83226731a
Extract the existing reserved-region free list and its regression controls
into a dependency-free no_std library. Add a serialized GlobalAlloc adapter
with explicit one-shot backing, exact-layout lifetime rules and scalar
failure observations. Keep memory acquisition, allocator registration and
native teardown policy with the caller. Implements #1.
docs: Clarify allocator contracts and consumer status
All checks were successful
CI / markdown (pull_request) Has been skipped
CI / rust (pull_request) Has been skipped
CI / rust (push) Successful in 1m13s
CI / markdown (push) Successful in 5s
3568441c07
Describe the published crate and the original-layout requirements of its
GlobalAlloc adapter. Update registration and Kernel migration milestones while
keeping consumer validation and native lifetime work open.
Author
Owner

The technical manual now documents caller-owned backing, serialized allocation, exact release obligations and native retirement limits. Docs #4 includes the chapter and the generated reference for all 14 public routes at 3568441c. Integration’s catalogs select this source and its manual. Native allocator registration and the Kernel probe remain open.

The technical manual now documents caller-owned backing, serialized allocation, exact release obligations and native retirement limits. [Docs #4](https://git.erikinkinen.fi/erix/docs/pulls/4) includes the chapter and the generated reference for all 14 public routes at `3568441c`. Integration’s catalogs select this source and its manual. Native allocator registration and the Kernel probe remain open.
feat: Resize allocations within their original region
Some checks failed
CI / rust (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Failing after 2s
CI / rust (push) Successful in 29s
494312f370
Grow into adjacent free storage or recycle shrunken tails before allocating a replacement. Preserve current layouts, payload prefixes and the original allocation on refusal, keeping serialized reallocation under its existing backing owner.
docs: Wrap allocator backing lifetime prose
All checks were successful
CI / rust (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / markdown (push) Successful in 3s
CI / rust (push) Successful in 28s
8949fee042
Keep the backing lifetime and resize obligations readable within the shared prose width.
erikinkinen added this to the Alpha 1 milestone 2026-10-30 09:34:48 +01:00
Author
Owner

Replaced by #5, #6. These feature branches preserve the original source in separate changes. Closing this combined PR without merging it; the original branch is retained.

Replaced by [#5](https://git.erikinkinen.fi/erix/lib-owned-region/pulls/5), [#6](https://git.erikinkinen.fi/erix/lib-owned-region/pulls/6). These feature branches preserve the original source in separate changes. Closing this combined PR without merging it; the original branch is retained.
erikinkinen closed this pull request 2026-10-30 15:26:31 +01:00
All checks were successful
CI / markdown (push) Successful in 3s
CI / rust (pull_request) Has been skipped
CI / markdown (pull_request) Has been skipped
CI / rust (push) Successful in 28s

Pull request closed

Sign in to join this conversation.
No description provided.