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 › zig › llvm › Builder › WipFunction › loadAtomic Public Function loadAtomic Doc Source 6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854 pub fn loadAtomic (
self : *WipFunction ,
access_kind : MemoryAccessKind ,
ty : Type ,
ptr : Value ,
sync_scope : SyncScope ,
ordering : AtomicOrdering ,
alignment : Alignment ,
name : []const u8 ,
) Allocator .Error !Value {
assert (ptr .typeOfWip (self ).isPointer (self .builder ));
try self .ensureUnusedExtraCapacity (1 , Instruction .Load , 0 );
const instruction = try self .addInst (name , .{
.tag = switch (ordering ) {
.none => .load ,
else => .@"load atomic" ,
},
.data = self .addExtraAssumeCapacity (Instruction .Load {
.info = .{
.access_kind = access_kind ,
.sync_scope = switch (ordering ) {
.none => .system ,
else => sync_scope ,
},
.success_ordering = ordering ,
.alignment = alignment ,
},
.type = ty ,
.ptr = ptr ,
}),
});
return instruction .toValue ();
}