summaryrefslogtreecommitdiff
path: root/src/FoldData.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/FoldData.zig')
-rw-r--r--src/FoldData.zig13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/FoldData.zig b/src/FoldData.zig
index a3d47af..e44e714 100644
--- a/src/FoldData.zig
+++ b/src/FoldData.zig
@@ -3,7 +3,6 @@ const builtin = @import("builtin");
3const compress = std.compress; 3const compress = std.compress;
4const mem = std.mem; 4const mem = std.mem;
5 5
6allocator: mem.Allocator,
7cutoff: u21 = undefined, 6cutoff: u21 = undefined,
8cwcf_exceptions_min: u21 = undefined, 7cwcf_exceptions_min: u21 = undefined,
9cwcf_exceptions_max: u21 = undefined, 8cwcf_exceptions_max: u21 = undefined,
@@ -24,7 +23,7 @@ pub fn init(allocator: mem.Allocator) !Self {
24 23
25 const endian = builtin.cpu.arch.endian(); 24 const endian = builtin.cpu.arch.endian();
26 25
27 var self = Self{ .allocator = allocator }; 26 var self = Self{};
28 self.cutoff = @intCast(try reader.readInt(u24, endian)); 27 self.cutoff = @intCast(try reader.readInt(u24, endian));
29 self.multiple_start = @intCast(try reader.readInt(u24, endian)); 28 self.multiple_start = @intCast(try reader.readInt(u24, endian));
30 29
@@ -53,11 +52,11 @@ pub fn init(allocator: mem.Allocator) !Self {
53 return self; 52 return self;
54} 53}
55 54
56pub fn deinit(self: *const Self) void { 55pub fn deinit(self: *const Self, allocator: mem.Allocator) void {
57 self.allocator.free(self.stage1); 56 allocator.free(self.stage1);
58 self.allocator.free(self.stage2); 57 allocator.free(self.stage2);
59 self.allocator.free(self.stage3); 58 allocator.free(self.stage3);
60 self.allocator.free(self.cwcf_exceptions); 59 allocator.free(self.cwcf_exceptions);
61} 60}
62 61
63/// Returns the case fold for `cp`. 62/// Returns the case fold for `cp`.