Re: [PATCH v7 01/26] rust: alloc: add `Allocator` trait

From: Danilo Krummrich
Date: Sun Sep 15 2024 - 17:39:37 EST


On Sun, Sep 15, 2024 at 09:08:27PM +0100, Gary Guo wrote:
> Just to add that if you *really* want to avoid the old layout param,
> another approach accceptable to me is to have a `NonZeroLayout` and have
> `alloc` only accept that.

That is a good idea, I like that.

>
> Either `Allocator` trait handles ZST well or it refuses to handle them
> at all. No "it works for alloc but not for free" please.

I agree with that, then we shouldn't handle them at all.

>
> Best,
> Gary
>
> > > >
> > > > >
> > > > > Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> > > > > Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx>
> > > > > ---
> > > > > rust/kernel/alloc.rs | 112 +++++++++++++++++++++++++++++++++++++++++++
> > > > > 1 file changed, 112 insertions(+)
> >
>