Skip to content

Commit

Permalink
fixed readme example
Browse files Browse the repository at this point in the history
  • Loading branch information
Aandreba committed Sep 3, 2024
1 parent 684fa38 commit 94d002c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 39 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ test "example" {
std.debug.print("Heap align: {}\n\n", .{Arc.innerAlign()});
var value = try Arc.init(std.testing.allocator, .{});
errdefer value.releaseWithFn(Data.deinit, .{});
errdefer if (value.releaseUnwrap()) |val| val.deinit();
var handles: [THREADS]Thread = undefined;
var i: usize = 0;
while (i < THREADS) {
const this_value = value.retain();
errdefer this_value.releaseWithFn(Data.deinit, .{});
errdefer if (this_value.releaseUnwrap()) |val| val.deinit();
handles[i] = try Thread.spawn(.{}, thread_exec, .{this_value});
i += 1;
}
Expand All @@ -86,7 +86,7 @@ test "example" {
}
fn thread_exec(data: Arc) !void {
defer data.releaseWithFn(Data.deinit, .{});
defer if (data.releaseUnwrap()) |val| val.deinit();
var rng = std.rand.DefaultPrng.init(@as(u64, @bitCast(@as(i64, @truncate(std.time.nanoTimestamp())))));
Expand Down
36 changes: 0 additions & 36 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,6 @@
// with this value.
.minimum_zig_version = "0.12.0",

// This field is optional.
// Each dependency must either provide a `url` and `hash`, or a `path`.
// `zig build --fetch` can be used to fetch all dependencies of a package, recursively.
// Once all dependencies are fetched, `zig build` no longer requires
// internet connectivity.
.dependencies = .{
// See `zig fetch --save <url>` for a command-line interface for adding dependencies.
//.example = .{
// // When updating this field to a new URL, be sure to delete the corresponding
// // `hash`, otherwise you are communicating that you expect to find the old hash at
// // the new URL.
// .url = "https://example.com/foo.tar.gz",
//
// // This is computed from the file contents of the directory of files that is
// // obtained after fetching `url` and applying the inclusion rules given by
// // `paths`.
// //
// // This field is the source of truth; packages do not come from a `url`; they
// // come from a `hash`. `url` is just one of many possible mirrors for how to
// // obtain a package matching this `hash`.
// //
// // Uses the [multihash](https://multiformats.io/multihash/) format.
// .hash = "...",
//
// // When this is provided, the package is found in a directory relative to the
// // build root. In this case the package's hash is irrelevant and therefore not
// // computed. This field and `url` are mutually exclusive.
// .path = "foo",

// // When this is set to `true`, a package is declared to be lazily
// // fetched. This makes the dependency only get fetched if it is
// // actually used.
// .lazy = false,
//},
},

// Specifies the set of files and directories that are included in this package.
// Only files and directories listed here are included in the `hash` that
// is computed for this package.
Expand Down

0 comments on commit 94d002c

Please sign in to comment.