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.

isLastAllocation

This has false negatives when the last allocation had an adjusted_index. In such case we won't be able to determine what the last allocation was because the alignForward operation done in alloc is not reversible.

FixedBufferAllocator.isLastAllocation
pub fn isLastAllocation(self: *FixedBufferAllocator, buf: []u8) bool

File

lib/std/heap/FixedBufferAllocator.zig:58

Code

pub fn isLastAllocation(self: *FixedBufferAllocator, buf: []u8) bool {
    return buf.ptr + buf.len == self.buffer.ptr + self.end_index;
}