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 standard library.
std › heap › ArenaAllocator › FuzzAllocator › remap Private Function remap Doc Source Private Function std.heap.ArenaAllocator.FuzzAllocator.remap
fn remap (ctx : *anyopaque , memory : []u8 , alignment : Alignment , new_len : usize , ret_addr : usize ) ?[*]u8 Params ctx : *anyopaque memory : []u8 alignment : Alignment new_len : usize ret_addr : usize File heap/ArenaAllocator.zig: 1059
1059
1060
1061
1062
1063
1064
1065
1066
1067 fn remap (ctx : *anyopaque , memory : []u8 , alignment : Alignment , new_len : usize , ret_addr : usize ) ?[*]u8 {
@disableInstrumentation ();
const fa : *FuzzAllocator = @ptrCast (@alignCast (ctx ));
_ = ret_addr ;
const index = @atomicRmw (u8 , &fa .index , .Add , 1 , .monotonic );
if (fa .spurious_failures [index ] != 0 ) return null ;
return fa .fba .threadSafeAllocator ().rawRemap (memory , alignment , new_len , @returnAddress ());
}