Re: [PATCH] rust: slab: add basic slab module
From: Vlastimil Babka
Date: Mon Sep 29 2025 - 03:14:14 EST
On 9/28/25 16:47, Danilo Krummrich wrote:
> On Thu Sep 25, 2025 at 11:54 AM CEST, Danilo Krummrich wrote:
>> (3) Implement a macro to generate a custom KmemCache Allocator trait
>> implementation for every KmemCache instance with a static lifetime.
>
> Thinking about it a bit more, I think we should go with option (3) for now.
>
> With its only limitation being that it always binds the lifetime of a kmemcache
> to the module lifetime, it still seems to be the best option, considering that
> the alternatives require additional synchronization in hot paths, may *silently*
> leak the kmemcache, cause significant code duplication or break dynamic
> dispatch.
>
> Tieing the kmemcache to the module lifetime should cover the vast majority of
> use-cases; should we ever really need something else we can still revisit the
> options.
Sounds good.
> Thanks,
> Danilo