Skip to content

API to split owned Vec into owned Vec chunks #40708

Closed
@NeoLegends

Description

@NeoLegends

I just came across the situation where it would be very useful to be able to split a Vec into several owned chunks just like std::slice::Chunks without an additional allocation. It seems to me like one would only have to update some pointers and lengths. split_off (unfortunately) allocates, so it cannot really be used for performance-critical paths.

How are your thoughts on such an API? Is this even possible with most allocators?

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions