[libc-commits] [libc] [libc] Refactor FreeTrie to support detached metadata and popmin (PR #203351)
Schrodinger ZHU Yifan via libc-commits
libc-commits at lists.llvm.org
Mon Jul 20 08:52:02 PDT 2026
SchrodingerZhu wrote:
> Can you clarify why this is necessary or beneficial for interaction with TLSF? (Aside from find_min; that seems fine.) Presently a `FreeTrie` is a Node pointer blessed with the knowledge necessary (a range) to use the pointer as a trie; if the goal is to allow the root of the trie to be stored elsewhere (say, in a TLSF bucket), then given how ephemerally `FreeTrie` objects are used in the follow-up patch, it seems semantically simpler to allow the root to be extracted via `root()` than to make this an object that expects storage of the pointer to be elsewhere. Then one can do manipulations on the `FreeTrie` and store the new root back; rinse and repeat.
In a TLSF setup, the range of the trie can be decided by the bin position (without materializing the meta).
https://github.com/llvm/llvm-project/pull/203351
More information about the libc-commits
mailing list