Function fromArrayListAligned [src]
Replaces array_list with empty, taking ownership of the memory.
Prototype
pub fn fromArrayListAligned( allocator: Allocator, comptime alignment: std.mem.Alignment, array_list: *std.array_list.Aligned(u8, alignment), ) Allocating
Parameters
allocator: Allocator
alignment: std.mem.Alignment
array_list: *std.array_list.Aligned(u8, alignment)
Source
pub fn fromArrayListAligned(
allocator: Allocator,
comptime alignment: std.mem.Alignment,
array_list: *std.array_list.Aligned(u8, alignment),
) Allocating {
defer array_list.* = .empty;
return .{
.allocator = allocator,
.writer = .{
.vtable = &vtable,
.buffer = array_list.allocatedSlice(),
.end = array_list.items.len,
},
.alignment = alignment,
};
}