Fixed missed merge text (oops)
Changed all *const Decompressor to *Decompressor Changed all decompressors to only stateless (my queues are borked)
This commit is contained in:
@@ -47,7 +47,7 @@ pub fn deinit(self: *Self) void {
|
||||
self.alloc.free(self.buf);
|
||||
}
|
||||
|
||||
fn decomp(d: ?*const Decompressor, alloc: std.mem.Allocator, in: []u8, out: []u8) Error!usize {
|
||||
fn decomp(d: ?*Decompressor, alloc: std.mem.Allocator, in: []u8, out: []u8) Error!usize {
|
||||
if (d == null) {
|
||||
return statelessDecomp(d, alloc, in, out);
|
||||
}
|
||||
@@ -70,7 +70,7 @@ inline fn zlibDecomp(buffer: []u8, in: []u8, out: []u8) !usize {
|
||||
|
||||
pub const stateless_decompressor: Decompressor = .{ .decomp_fn = statelessDecomp };
|
||||
|
||||
fn statelessDecomp(_: ?*const Decompressor, alloc: std.mem.Allocator, in: []u8, out: []u8) Error!usize {
|
||||
fn statelessDecomp(_: ?*Decompressor, alloc: std.mem.Allocator, in: []u8, out: []u8) Error!usize {
|
||||
const buf = try alloc.alloc(u8, out.len);
|
||||
defer alloc.free(buf);
|
||||
return zlibDecomp(buf, in, out);
|
||||
|
||||
Reference in New Issue
Block a user