DoxigAlpha

fromOwnedSlice

ArrayList takes ownership of the passed in slice. The slice must have been allocated with gpa. Deinitialize with deinit or use toOwnedSlice.

Function parameters

Parameters

#

Deprecated.

Functions

#
Managed
Deprecated.
AlignedManaged
Deprecated.
Aligned
A contiguous, growable list of arbitrarily aligned items in memory.

Source

Implementation

#
pub fn fromOwnedSlice(gpa: Allocator, slice: Slice) Self {
    return Self{
        .items = slice,
        .capacity = slice.len,
        .allocator = gpa,
    };
}