lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJ-ks9nOh49+Wpm2i-dvrHvHWU6C0O_ZHgz=TNHyBv3Zaew3oA@mail.gmail.com>
Date: Wed, 16 Apr 2025 13:14:44 -0400
From: Tamir Duberstein <tamird@...il.com>
To: Alice Ryhl <aliceryhl@...gle.com>
Cc: Danilo Krummrich <dakr@...nel.org>, Andrew Ballance <andrewjballance@...il.com>, 
	Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>, 
	Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>, 
	Björn Roy Baron <bjorn3_gh@...tonmail.com>, 
	Benno Lossin <benno.lossin@...ton.me>, Andreas Hindborg <a.hindborg@...nel.org>, 
	Trevor Gross <tmgross@...ch.edu>, rust-for-linux@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/4] rust: alloc: add Vec::len() <= Vec::capacity invariant

On Wed, Apr 16, 2025 at 10:41 AM Alice Ryhl <aliceryhl@...gle.com> wrote:
>
> On Mon, Apr 7, 2025 at 4:52 PM Tamir Duberstein <tamird@...il.com> wrote:
> >
> > Document the invariant that the vector's length is always less than or
> > equal to its capacity. This is already implied by these other
> > invariants:
> >
> > - `self.len` always represents the exact number of elements stored in
> >   the vector.
> > - `self.layout` represents the absolute number of elements that can be
> >   stored within the vector without re-allocation.
> >
> > but it doesn't hurt to spell it out. Note that the language references
> > `self.capacity` rather than `self.layout.len` as the latter is zero for
> > a vector of ZSTs.
> >
> > Update a safety comment touched by this patch to correctly reference
> > `realloc` rather than `alloc` and replace "leaves" with "leave" to
> > improve grammar.
> >
> > Signed-off-by: Tamir Duberstein <tamird@...il.com>
>
> This change has a conflict with the spare_capacity_mut patch in alloc-next.

Indeed. I have resolved it locally but was holding off until some
reviews arrived. I guess I'll respin now.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ