diff --git a/build.zig.version b/build.zig.version index 3cfe6f2..930e300 100644 --- a/build.zig.version +++ b/build.zig.version @@ -1 +1 @@ -0.15.0-dev.703+597dd328e +0.14.1 diff --git a/build.zig.zon b/build.zig.zon index e66f66f..feb6ad0 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -27,8 +27,8 @@ .hash = "fuzzig-0.1.1-AAAAALNIAQBmbHr-MPalGuR393Vem2pTQXI7_LXeNJgX", }, .vaxis = .{ - .url = "https://github.com/neurocyte/libvaxis/archive/64a29f4f91292bc79dc9afb9a254cbdfb35e29a6.tar.gz", - .hash = "vaxis-0.1.0-BWNV_KEOCQCzedUR1prWhPUcgsRmw8f-r5JBc3s4DLJf", + .url = "https://github.com/neurocyte/libvaxis/archive/6137cb4c44a7350996f0946a069739e5075d1f23.tar.gz", + .hash = "vaxis-0.1.0-BWNV_HwOCQCw5wTV63hQGSc1QJzsNcytH6sGf1GBc0hP", }, .zeit = .{ .url = "https://github.com/rockorager/zeit/archive/8fd203f85f597f16e0a525c1f1ca1e0bffded809.tar.gz", diff --git a/src/buffer/Buffer.zig b/src/buffer/Buffer.zig index b86af65..c90bf76 100644 --- a/src/buffer/Buffer.zig +++ b/src/buffer/Buffer.zig @@ -1222,7 +1222,6 @@ pub const LoadFromFileError = error{ LockViolation, ProcessNotFound, Canceled, - PermissionDenied, }; pub fn load_from_file( @@ -1328,8 +1327,6 @@ pub const StoreToFileError = error{ SystemResources, Unexpected, WouldBlock, - PermissionDenied, - MessageTooBig, }; pub fn store_to_existing_file_const(self: *const Self, file_path: []const u8) StoreToFileError!void { diff --git a/src/log.zig b/src/log.zig index 4c4e038..71d3521 100644 --- a/src/log.zig +++ b/src/log.zig @@ -10,14 +10,9 @@ receiver: Receiver, subscriber: ?tp.pid, heap: [32 + 1024]u8, fba: std.heap.FixedBufferAllocator, -msg_store: MsgStore, - -const MsgStore = std.DoublyLinkedList; -const MsgStoreEntry = struct { - data: []u8, - node: MsgStore.Node, -}; +msg_store: MsgStoreT, +const MsgStoreT = std.DoublyLinkedList([]u8); const Receiver = tp.Receiver(*Self); const StartArgs = struct { @@ -43,7 +38,7 @@ fn init(args: StartArgs) !*Self { .subscriber = null, .heap = undefined, .fba = std.heap.FixedBufferAllocator.init(&p.heap), - .msg_store = MsgStore{}, + .msg_store = MsgStoreT{}, }; return p; } @@ -60,18 +55,17 @@ fn log(msg: []const u8) void { fn store(self: *Self, m: tp.message) void { const allocator: std.mem.Allocator = self.fba.allocator(); const buf: []u8 = allocator.alloc(u8, m.len()) catch return; - var msg: *MsgStoreEntry = allocator.create(MsgStoreEntry) catch return; - msg.data = buf; + var node: *MsgStoreT.Node = allocator.create(MsgStoreT.Node) catch return; + node.data = buf; @memcpy(buf, m.buf); - self.msg_store.append(&msg.node); + self.msg_store.append(node); } fn store_send(self: *Self) void { var node = self.msg_store.first; if (self.subscriber) |sub| { while (node) |node_| { - const msg: *MsgStoreEntry = @fieldParentPtr("node", node_); - sub.send_raw(tp.message{ .buf = msg.data }) catch return; + sub.send_raw(tp.message{ .buf = node_.data }) catch return; node = node_.next; } } @@ -79,7 +73,7 @@ fn store_send(self: *Self) void { } fn store_reset(self: *Self) void { - self.msg_store = MsgStore{}; + self.msg_store = MsgStoreT{}; self.fba.reset(); }