p2 build tests
This commit is contained in:
parent
9a295f3f2f
commit
b2495bcff7
|
|
@ -1,8 +1,9 @@
|
||||||
.{
|
.{
|
||||||
.name = "miniaudio",
|
.name = .miniaudio,
|
||||||
.version = "0.0.0",
|
.version = "0.0.0",
|
||||||
.dependencies = .{},
|
.dependencies = .{},
|
||||||
.paths = .{
|
.paths = .{
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
|
.fingerprint = 0xaeac616fa937921a,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
.{
|
.{
|
||||||
.name = "nfd",
|
.name = .nfd,
|
||||||
.version = "0.0.0",
|
.version = "0.0.0",
|
||||||
.dependencies = .{ .p2 = .{ .path = "../p2" } },
|
.dependencies = .{ .p2 = .{ .path = "../p2" } },
|
||||||
.paths = .{
|
.paths = .{
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
|
.fingerprint = 0xc4705658dee6a489,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,14 +73,14 @@ pub const Span = spans.Span;
|
||||||
pub const shell = @import("utils/shell.zig");
|
pub const shell = @import("utils/shell.zig");
|
||||||
|
|
||||||
comptime {
|
comptime {
|
||||||
// std.testing.refAllDecls(utils);
|
std.testing.refAllDecls(utils);
|
||||||
// std.testing.refAllDecls(static_structures);
|
std.testing.refAllDecls(static_structures);
|
||||||
// std.testing.refAllDecls(ring_queue);
|
std.testing.refAllDecls(ring_queue);
|
||||||
// std.testing.refAllDecls(sparse_set);
|
std.testing.refAllDecls(sparse_set);
|
||||||
// std.testing.refAllDecls(stack_structures);
|
std.testing.refAllDecls(stack_structures);
|
||||||
// std.testing.refAllDecls(index_pool);
|
std.testing.refAllDecls(index_pool);
|
||||||
// std.testing.refAllDecls(concurrent_queue);
|
std.testing.refAllDecls(concurrent_queue);
|
||||||
// std.testing.refAllDecls(string_pool);
|
std.testing.refAllDecls(string_pool);
|
||||||
std.testing.refAllDecls(spans);
|
std.testing.refAllDecls(spans);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ pub fn ConcurrentQueueUnmanagedAdvanced(comptime T: type, comptime opts: struct
|
||||||
// tail points to next free slot
|
// tail points to next free slot
|
||||||
// head points to the next one to pop
|
// head points to the next one to pop
|
||||||
pub fn initCapacity(allocator: std.mem.Allocator, cap: usize) !@This() {
|
pub fn initCapacity(allocator: std.mem.Allocator, cap: usize) !@This() {
|
||||||
const new = .{
|
const new = @This(){
|
||||||
.data = try allocator.alloc(T, cap + 1),
|
.data = try allocator.alloc(T, cap + 1),
|
||||||
.status = try allocator.alloc(Atomic(bool), cap + 1),
|
.status = try allocator.alloc(Atomic(bool), cap + 1),
|
||||||
.head = Atomic(usize).init(0),
|
.head = Atomic(usize).init(0),
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ test "index pool test" {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert 1 randomly add and delete objects another million objects in groups
|
// Insert 1 randomly add and delete objects another million objects in groups
|
||||||
var prng = std.rand.DefaultPrng.init(0x1234);
|
var prng = std.Random.DefaultPrng.init(0x1234);
|
||||||
var rand = prng.random();
|
var rand = prng.random();
|
||||||
|
|
||||||
var workBuffer: [5]Handle = .{ .{}, .{}, .{}, .{}, .{} };
|
var workBuffer: [5]Handle = .{ .{}, .{}, .{}, .{}, .{} };
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,6 @@ const StringAllocation = struct {
|
||||||
const rc: [*]std.atomic.Value(u8) = @ptrCast(self.ptr); //+= 1;
|
const rc: [*]std.atomic.Value(u8) = @ptrCast(self.ptr); //+= 1;
|
||||||
|
|
||||||
if (rc[3].fetchSub(1, .release) == 1) {
|
if (rc[3].fetchSub(1, .release) == 1) {
|
||||||
rc[3].fence(.acquire);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -203,7 +202,7 @@ const Bucket = struct {
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
} else {
|
} else {
|
||||||
const index = self.freeSlots.pop();
|
const index = self.freeSlots.pop().?;
|
||||||
|
|
||||||
const rv: BucketAllocation = .{
|
const rv: BucketAllocation = .{
|
||||||
.bytes = self.indexToSlot(self.i2p(index), self.ibp(index)),
|
.bytes = self.indexToSlot(self.i2p(index), self.ibp(index)),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue