Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserSliceReader::read_all should work with any Vec allocator #1136

Open
Darksonn opened this issue Dec 20, 2024 · 0 comments
Open

UserSliceReader::read_all should work with any Vec allocator #1136

Darksonn opened this issue Dec 20, 2024 · 0 comments
Labels
• lib Related to the `rust/` library.

Comments

@Darksonn
Copy link
Collaborator

The UserSliceReader::read_all function currently has this signature:

scr

This means that it can only be used with the kmalloc allocator. However, there's no reason for this restriction. The function could work with any Vec no matter what the allocator is.

@ojeda ojeda added the • lib Related to the `rust/` library. label Dec 20, 2024
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Dec 22, 2024
The UserSliceReader::read_all function is currently restricted to use
only Vec with the kmalloc allocator.
However, there is no reason for this limitation.
This patch generalizes the function to accept any Vec regardless of the
allocator used.

Link: Rust-for-Linux#1136
Signed-off-by: Filipe Xavier <[email protected]>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Jan 7, 2025
The UserSliceReader::read_all function is currently restricted to use
only Vec with the kmalloc allocator.
However, there is no reason for this limitation.
This patch generalizes the function to accept any Vec regardless of the
allocator used.
There's a use-case for a KVVec in Binder to avoid maximum
sizes for a certain array.

Link: Rust-for-Linux#1136
Signed-off-by: Filipe Xavier <[email protected]>
ojeda pushed a commit to ojeda/linux that referenced this issue Jan 13, 2025
The UserSliceReader::read_all function is currently restricted to use
only Vec with the kmalloc allocator. However, there is no reason for
this limitation.

This patch generalizes the function to accept any Vec regardless of the
allocator used.

There's a use-case for a KVVec in Binder to avoid maximum sizes for a
certain array.

Link: Rust-for-Linux#1136
Signed-off-by: Filipe Xavier <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Boqun Feng <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Reflowed and slightly reworded title. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
ojeda pushed a commit that referenced this issue Jan 13, 2025
The UserSliceReader::read_all function is currently restricted to use
only Vec with the kmalloc allocator. However, there is no reason for
this limitation.

This patch generalizes the function to accept any Vec regardless of the
allocator used.

There's a use-case for a KVVec in Binder to avoid maximum sizes for a
certain array.

Link: #1136
Signed-off-by: Filipe Xavier <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Reviewed-by: Boqun Feng <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Reflowed and slightly reworded title. - Miguel ]
Signed-off-by: Miguel Ojeda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
• lib Related to the `rust/` library.
Development

No branches or pull requests

2 participants