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 › storeAtomic Public Function storeAtomic Doc Source 6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897 pub fn storeAtomic (
self : *WipFunction ,
access_kind : MemoryAccessKind ,
val : Value ,
ptr : Value ,
sync_scope : SyncScope ,
ordering : AtomicOrdering ,
alignment : Alignment ,
) Allocator .Error !Instruction .Index {
assert (ptr .typeOfWip (self ).isPointer (self .builder ));
try self .ensureUnusedExtraCapacity (1 , Instruction .Store , 0 );
const instruction = try self .addInst (null , .{
.tag = switch (ordering ) {
.none => .store ,
else => .@"store atomic" ,
},
.data = self .addExtraAssumeCapacity (Instruction .Store {
.info = .{
.access_kind = access_kind ,
.sync_scope = switch (ordering ) {
.none => .system ,
else => sync_scope ,
},
.success_ordering = ordering ,
.alignment = alignment ,
},
.val = val ,
.ptr = ptr ,
}),
});
return instruction ;
}