Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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 standard library. Public Function

isLastAllocation

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

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.

Params

File

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