DoxigAlpha

copyAtomicStore

Function parameters

Parameters

#
dest:[]align(@alignOf(usize)) u8
src:[]const u8

Type definitions in this namespace

Types

#
Node
Represents one unit of progress.

Initializes a global Progress instance.

Functions

#
start
Initializes a global Progress instance.
lockStdErr
Allows the caller to freely write to stderr until `unlockStdErr` is called.
lockStderrWriter
Allows the caller to freely write to the returned `Writer`,

= switch (builtin.os.tag) { .wasi, .freestanding, .windows => false, else => true, }

Values

#
have_ipc
= switch (builtin.os.tag) { .wasi, .freestanding, .windows => false, else => true, }

Source

Implementation

#
fn copyAtomicStore(dest: []align(@alignOf(usize)) u8, src: []const u8) void {
    assert(dest.len == src.len);
    const chunked_len = dest.len / @sizeOf(usize);
    const dest_chunked: []usize = @as([*]usize, @ptrCast(dest))[0..chunked_len];
    const src_chunked: []align(1) const usize = @as([*]align(1) const usize, @ptrCast(src))[0..chunked_len];
    for (dest_chunked, src_chunked) |*d, s| {
        @atomicStore(usize, d, s, .monotonic);
    }
    const remainder_start = chunked_len * @sizeOf(usize);
    for (dest[remainder_start..], src[remainder_start..]) |*d, s| {
        @atomicStore(u8, d, s, .monotonic);
    }
}