diff options
| author | 2021-12-06 20:18:55 +1100 | |
|---|---|---|
| committer | 2021-12-06 10:18:55 +0100 | |
| commit | cf8a34d11f0520bdf2afc08eda88862597a88b23 (patch) | |
| tree | 399d4fdb50ff8ee20cb0f8e30ea9d811421abf14 /clap.zig | |
| parent | Fix regression in last commit (diff) | |
| download | zig-clap-cf8a34d11f0520bdf2afc08eda88862597a88b23.tar.gz zig-clap-cf8a34d11f0520bdf2afc08eda88862597a88b23.tar.xz zig-clap-cf8a34d11f0520bdf2afc08eda88862597a88b23.zip | |
zig master updates: allocator changes (#60)
Diffstat (limited to 'clap.zig')
| -rw-r--r-- | clap.zig | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -337,7 +337,7 @@ pub const ParseOptions = struct { | |||
| 337 | /// `parse`, `parseEx` does not wrap the allocator so the heap allocator can be | 337 | /// `parse`, `parseEx` does not wrap the allocator so the heap allocator can be |
| 338 | /// quite expensive. (TODO: Can we pick a better default? For `parse`, this allocator | 338 | /// quite expensive. (TODO: Can we pick a better default? For `parse`, this allocator |
| 339 | /// is fine, as it wraps it in an arena) | 339 | /// is fine, as it wraps it in an arena) |
| 340 | allocator: *mem.Allocator = heap.page_allocator, | 340 | allocator: mem.Allocator = heap.page_allocator, |
| 341 | diagnostic: ?*Diagnostic = null, | 341 | diagnostic: ?*Diagnostic = null, |
| 342 | }; | 342 | }; |
| 343 | 343 | ||
| @@ -350,7 +350,7 @@ pub fn parse( | |||
| 350 | var iter = try args.OsIterator.init(opt.allocator); | 350 | var iter = try args.OsIterator.init(opt.allocator); |
| 351 | const clap = try parseEx(Id, params, &iter, .{ | 351 | const clap = try parseEx(Id, params, &iter, .{ |
| 352 | // Let's reuse the arena from the `OSIterator` since we already have it. | 352 | // Let's reuse the arena from the `OSIterator` since we already have it. |
| 353 | .allocator = &iter.arena.allocator, | 353 | .allocator = iter.arena.allocator(), |
| 354 | .diagnostic = opt.diagnostic, | 354 | .diagnostic = opt.diagnostic, |
| 355 | }); | 355 | }); |
| 356 | 356 | ||