Re: [PATCH] rust: slab: add basic slab module

Alice Ryhl
2025-09-25T17:54:42Z

On Thu, Sep 25, 2025 at 11:54 AM Danilo Krummrich <dakr@kernel.org> wrote:
> (3) Implement a macro to generate a custom KmemCache Allocator trait
> implementation for every KmemCache instance with a static lifetime.
>
> This makes KmemCache technically equivalent to the other allocators, such
> as Kmalloc, etc. but obviously has the downside that the KmemCache might
> live much longer than required.
>
> Technically, most KmemCache instances live for the whole module lifetime,
> so it might be fine though.
>
> (This is what I think Alice proposed.)

Yes, this is what I proposed. Most kmemcaches live for the duration of
the module, so it's no issue if they are global.

Alice