On Sun, Mar 16, 2025 at 7:17 AM Andrew Ballance
wrote:
>
> implement the equivalent of the rust std's Vec::resize
> on the kernel's Vec type.
>
> Signed-off-by: Andrew Ballance
> ---
> rust/kernel/alloc/kvec.rs | 26 ++
> 1 file changed, 26 insertions(+)
>
> diff --git a/
On Wed, Mar 19, 2025 at 12:43 PM Miguel Ojeda
wrote:
>
> On Wed, Mar 19, 2025 at 5:13 PM Tamir Duberstein wrote:
> >
> > No, I meant avoiding the check. The existing code already explicitly
> > checks `new_len > self.len()` before evaluating `new_len -
> > self.len()`. This means the check occurs
On Wed, Mar 19, 2025 at 5:13 PM Tamir Duberstein wrote:
>
> No, I meant avoiding the check. The existing code already explicitly
> checks `new_len > self.len()` before evaluating `new_len -
> self.len()`. This means the check occurs twice. `checked_sub` reduces
> the number of checks by 1. Perhaps
On Wed, Mar 19, 2025 at 12:06 PM Miguel Ojeda
wrote:
>
> On Wed, Mar 19, 2025 at 4:59 PM Tamir Duberstein wrote:
> >
> > If we're talking about the same thing then I think we're both wrong
> > and the correct phrasing would have been: "you can avoid underflow
> > checking when CONFIG_RUST_OVERFLO
On Wed, Mar 19, 2025 at 4:59 PM Tamir Duberstein wrote:
>
> If we're talking about the same thing then I think we're both wrong
> and the correct phrasing would have been: "you can avoid underflow
> checking when CONFIG_RUST_OVERFLOW_CHECKS=y by using `checked_sub`". I
> was referring to the under
On Wed, Mar 19, 2025 at 10:34 AM Benno Lossin wrote:
>
> On Wed Mar 19, 2025 at 2:42 PM CET, Tamir Duberstein wrote:
> > On Tue, Mar 18, 2025 at 8:50 PM Benno Lossin wrote:
> >>
> >> On Tue Mar 18, 2025 at 9:12 PM CET, Tamir Duberstein wrote:
> >> > On Sun, Mar 16, 2025 at 7:17 AM Andrew Ballance
On Wed Mar 19, 2025 at 2:42 PM CET, Tamir Duberstein wrote:
> On Tue, Mar 18, 2025 at 8:50 PM Benno Lossin wrote:
>>
>> On Tue Mar 18, 2025 at 9:12 PM CET, Tamir Duberstein wrote:
>> > On Sun, Mar 16, 2025 at 7:17 AM Andrew Ballance
>> > wrote:
>> >> +pub fn resize(&mut self, new_len: usize,
On Tue, Mar 18, 2025 at 8:50 PM Benno Lossin wrote:
>
> On Tue Mar 18, 2025 at 9:12 PM CET, Tamir Duberstein wrote:
> > On Sun, Mar 16, 2025 at 7:17 AM Andrew Ballance
> > wrote:
> >> +pub fn resize(&mut self, new_len: usize, value: T, flags: Flags) ->
> >> Result<(), AllocError> {
> >> +
On Tue Mar 18, 2025 at 9:12 PM CET, Tamir Duberstein wrote:
> On Sun, Mar 16, 2025 at 7:17 AM Andrew Ballance
> wrote:
>> +pub fn resize(&mut self, new_len: usize, value: T, flags: Flags) ->
>> Result<(), AllocError> {
>> +if new_len > self.len() {
>> +self.extend_with(new
On Sun Mar 16, 2025 at 12:16 PM CET, Andrew Ballance wrote:
> implement the equivalent of the rust std's Vec::resize
> on the kernel's Vec type.
>
> Signed-off-by: Andrew Ballance
Reviewed-by: Benno Lossin
---
Cheers,
Benno
> ---
> rust/kernel/alloc/kvec.rs | 26 ++
>
implement the equivalent of the rust std's Vec::resize
on the kernel's Vec type.
Signed-off-by: Andrew Ballance
---
rust/kernel/alloc/kvec.rs | 26 ++
1 file changed, 26 insertions(+)
diff --git a/rust/kernel/alloc/kvec.rs b/rust/kernel/alloc/kvec.rs
index 18bcc59f0b38..
11 matches
Mail list logo