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

Danilo Krummrich
2024-09-15T21:39:29Z

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@google.com>
> > > > > Signed-off-by: Danilo Krummrich <dakr@kernel.org>
> > > > > ---
> > > > > rust/kernel/alloc.rs | 112 +++++++++++++++++++++++++++++++++++++++++++
> > > > > 1 file changed, 112 insertions(+)
> >
>