pub fn fromOwnedSliceSentinel(gpa: Allocator, comptime sentinel: T, slice: [:sentinel]T) Self
ArrayList takes ownership of the passed in slice. The slice must have been allocated with gpa. Deinitialize with deinit or use toOwnedSlice.
gpa
deinit
toOwnedSlice
gpa: Allocator
sentinel: T
slice: [:sentinel]T
105 106 107 108 109 110 111 112
pub fn fromOwnedSliceSentinel(gpa: Allocator, comptime sentinel: T, slice: [:sentinel]T) Self { return Self{ .items = slice, .capacity = slice.len + 1, .allocator = gpa, .pointer_stability = .{}, }; }
ArrayList takes ownership of the passed in slice. The slice must have been allocated with
gpa. Deinitialize withdeinitor usetoOwnedSlice.