Zig NEWS

Discussion on: Resource efficient Thread Pools with Zig

Collapse
ddsimoes profile image
Daniel Simões

Hi. Great post!

Zig newbie question.

When I try to build the bechmark (blog branch) with Zig 0.9.0 using -Dc (Linux) the compiler throws an error:

/tmp/zap/benchmarks/zig (blog)$ zig build -Dc
./async.zig:64:29: error: expected type '*std.mem.Allocator', found 'std.mem.Allocator'
        allocator = std.heap.c_allocator;
                            ^
./qsort.zig:7:21: note: called from here
    return Async.run(asyncMain, .{});
                    ^
./qsort.zig:6:20: note: called from here
pub fn main() void {
                   ^
/snap/zig/4409/lib/std/mem/Allocator.zig:1:1: note: std.mem.Allocator declared here
//! The standard memory allocation interface.
^
qsort...The following command exited with error code 1:
/snap/zig/4409/zig build-exe /tmp/zap/benchmarks/zig/qsort.zig -lc --cache-dir /tmp/zap/benchmarks/zig/zig-cache --global-cache-dir /home/daniel/.cache/zig --name qsort --pkg-begin thread_pool /tmp/zap/src/thread_pool.zig --pkg-end --enable-cache 
error: the following build command failed with exit code 1:
Enter fullscreen mode Exit fullscreen mode

What is happening?

Collapse
kprotty profile image
Protty Author

The code in the example is out of date with the current master branch and needs to be updated. This particular error was because allocator interfaces changed

Collapse
ddsimoes profile image
Daniel Simões

Oh I see.
Thank you!