diff options
Diffstat (limited to 'src/NormPropsData.zig')
| -rw-r--r-- | src/NormPropsData.zig | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/NormPropsData.zig b/src/NormPropsData.zig index 5861860..e79ae91 100644 --- a/src/NormPropsData.zig +++ b/src/NormPropsData.zig | |||
| @@ -4,7 +4,6 @@ const compress = std.compress; | |||
| 4 | const mem = std.mem; | 4 | const mem = std.mem; |
| 5 | const testing = std.testing; | 5 | const testing = std.testing; |
| 6 | 6 | ||
| 7 | allocator: mem.Allocator, | ||
| 8 | s1: []u16 = undefined, | 7 | s1: []u16 = undefined, |
| 9 | s2: []u4 = undefined, | 8 | s2: []u4 = undefined, |
| 10 | 9 | ||
| @@ -18,7 +17,7 @@ pub fn init(allocator: mem.Allocator) !Self { | |||
| 18 | var reader = in_decomp.reader(); | 17 | var reader = in_decomp.reader(); |
| 19 | 18 | ||
| 20 | const endian = builtin.cpu.arch.endian(); | 19 | const endian = builtin.cpu.arch.endian(); |
| 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 | ||
| 36 | pub fn deinit(self: *const Self) void { | 35 | pub 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 true if `cp` is already in NFD form. | 40 | /// Returns true if `cp` is already in NFD form. |