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
Request to modify the size of an allocation, allowing relocation.
A non-null return value indicates the resize was successful. The allocation may have same address, or may have been relocated. In either case, the allocation now has size of new_len. A null return value indicates that the resize would be equivalent to allocating new memory, copying the bytes from the old memory, and then freeing the old memory. In such case, it is more efficient for the caller to perform those operations.
allocation may be an empty slice, in which case null is returned, unless new_len is also 0, in which case allocation is returned.
new_len may be zero, in which case the allocation is freed.
If the allocation's elements' type is zero bytes sized, allocation.len is set to new_len.
Request to modify the size of an allocation, allowing relocation.
A non-
nullreturn value indicates the resize was successful. The allocation may have same address, or may have been relocated. In either case, the allocation now has size ofnew_len. Anullreturn value indicates that the resize would be equivalent to allocating new memory, copying the bytes from the old memory, and then freeing the old memory. In such case, it is more efficient for the caller to perform those operations.allocationmay be an empty slice, in which casenullis returned, unlessnew_lenis also 0, in which caseallocationis returned.new_lenmay be zero, in which case the allocation is freed.If the allocation's elements' type is zero bytes sized,
allocation.lenis set tonew_len.