Skip to content

refactor(pool): clarify type - #1782

Open
ayushmishra2005 wants to merge 1 commit into
Syndica:mainfrom
ayushmishra2005:refactor/pool-clarify-type
Open

ayushmishra2005 wants to merge 1 commit into
Syndica:mainfrom
ayushmishra2005:refactor/pool-clarify-type

Conversation

@ayushmishra2005

Copy link
Copy Markdown

Closes #1706

Intent

Improve the readability of SharedPool's trailing storage representation and simplify pool initialization without changing behavior.

Implementation

  • Replaced the trailing marker field

    void align(@alignOf(Node))

    with

    [0]Node

which preserves layout while more clearly expressing the flexible-array pattern.

  • Simplified buf() and constBuf() by removing unnecessary pointer casts.
  • Added initInBuffer, allowing callers to initialize a pool directly from an aligned byte buffer while validating the required size.
  • Updated replay service call sites to use the new helper.
  • Added tests covering:
    • layout assumptions
    • initialization from a buffer
    • allocation, exhaustion, free, and reuse

@github-project-automation github-project-automation Bot moved this to 🏗 In progress in Sig Aug 6, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

refactor(pool): clarify type

1 participant