summaryrefslogtreecommitdiff
path: root/src/GenCatData.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/GenCatData.zig')
-rw-r--r--src/GenCatData.zig11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/GenCatData.zig b/src/GenCatData.zig
index 5ce9fb6..a69f7a2 100644
--- a/src/GenCatData.zig
+++ b/src/GenCatData.zig
@@ -37,7 +37,6 @@ pub const Gc = enum {
37 Zs, // Separator, Space 37 Zs, // Separator, Space
38}; 38};
39 39
40allocator: mem.Allocator,
41s1: []u16 = undefined, 40s1: []u16 = undefined,
42s2: []u5 = undefined, 41s2: []u5 = undefined,
43s3: []u5 = undefined, 42s3: []u5 = undefined,
@@ -53,7 +52,7 @@ pub fn init(allocator: mem.Allocator) !Self {
53 52
54 const endian = builtin.cpu.arch.endian(); 53 const endian = builtin.cpu.arch.endian();
55 54
56 var self = Self{ .allocator = allocator }; 55 var self = Self{};
57 56
58 const s1_len: u16 = try reader.readInt(u16, endian); 57 const s1_len: u16 = try reader.readInt(u16, endian);
59 self.s1 = try allocator.alloc(u16, s1_len); 58 self.s1 = try allocator.alloc(u16, s1_len);
@@ -73,10 +72,10 @@ pub fn init(allocator: mem.Allocator) !Self {
73 return self; 72 return self;
74} 73}
75 74
76pub fn deinit(self: *const Self) void { 75pub fn deinit(self: *const Self, allocator: mem.Allocator) void {
77 self.allocator.free(self.s1); 76 allocator.free(self.s1);
78 self.allocator.free(self.s2); 77 allocator.free(self.s2);
79 self.allocator.free(self.s3); 78 allocator.free(self.s3);
80} 79}
81 80
82/// Lookup the General Category for `cp`. 81/// Lookup the General Category for `cp`.