summaryrefslogtreecommitdiff
path: root/src/CombiningData.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/CombiningData.zig')
-rw-r--r--src/CombiningData.zig9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/CombiningData.zig b/src/CombiningData.zig
index 44140f8..b5e227a 100644
--- a/src/CombiningData.zig
+++ b/src/CombiningData.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,
7s1: []u16 = undefined, 6s1: []u16 = undefined,
8s2: []u8 = undefined, 7s2: []u8 = undefined,
9 8
@@ -18,7 +17,7 @@ pub fn init(allocator: mem.Allocator) !Self {
18 17
19 const endian = builtin.cpu.arch.endian(); 18 const endian = builtin.cpu.arch.endian();
20 19
21 var self = Self{ .allocator = allocator }; 20 var self = Self{};
22 21
23 const stage_1_len: u16 = try reader.readInt(u16, endian); 22 const stage_1_len: u16 = try reader.readInt(u16, endian);
24 self.s1 = try allocator.alloc(u16, stage_1_len); 23 self.s1 = try allocator.alloc(u16, stage_1_len);
@@ -33,9 +32,9 @@ pub fn init(allocator: mem.Allocator) !Self {
33 return self; 32 return self;
34} 33}
35 34
36pub fn deinit(self: *const Self) void { 35pub fn deinit(self: *const Self, allocator: mem.Allocator) void {
37 self.allocator.free(self.s1); 36 allocator.free(self.s1);
38 self.allocator.free(self.s2); 37 allocator.free(self.s2);
39} 38}
40 39
41/// Returns the canonical combining class for a code point. 40/// Returns the canonical combining class for a code point.