Zig 0.17.0-dev (Split by item)
This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig library itself.
Zig › std/ › os/ › uefi/ › tables.zig › MemoryMapSlice
MemoryMapSlice
tables.MemoryMapSlice
pub const MemoryMapSlice = struct
File
Code
pub const MemoryMapSlice = struct {
info : MemoryMapInfo ,
ptr : [*]align (@alignOf (MemoryDescriptor )) u8 ,
pub fn iterator (self : MemoryMapSlice ) MemoryDescriptorIterator {
return .{ .ctx = self };
}
pub fn get (self : MemoryMapSlice , index : usize ) ?*MemoryDescriptor {
if (index >= self .info .len ) return null ;
return self .getUnchecked (index );
}
pub fn getUnchecked (self : MemoryMapSlice , index : usize ) *MemoryDescriptor {
const offset : usize = index * self .info .descriptor_size ;
return @ptrCast (@alignCast (self .ptr [offset ..]));
}
}