diff options
| author | 2023-12-13 08:53:06 +0100 | |
|---|---|---|
| committer | 2023-12-13 08:53:06 +0100 | |
| commit | feffdff4094ea3927eb3880b46b65e700f1e86fb (patch) | |
| tree | 071a86610548ebed5b8bec0617cf79cbeeee65fd /clap.zig | |
| parent | Fix short only params not getting fields in `Arguments` (diff) | |
| download | zig-clap-no-default-allocator.tar.gz zig-clap-no-default-allocator.tar.xz zig-clap-no-default-allocator.zip | |
Remove the default allocator from `ParseOptions`no-default-allocator
fixes #111
Diffstat (limited to 'clap.zig')
| -rw-r--r-- | clap.zig | 7 |
1 files changed, 1 insertions, 6 deletions
| @@ -641,12 +641,7 @@ test "Diagnostic.report" { | |||
| 641 | 641 | ||
| 642 | /// Options that can be set to customize the behavior of parsing. | 642 | /// Options that can be set to customize the behavior of parsing. |
| 643 | pub const ParseOptions = struct { | 643 | pub const ParseOptions = struct { |
| 644 | /// The allocator used for all memory allocations. Defaults to the `heap.page_allocator`. | 644 | allocator: mem.Allocator, |
| 645 | /// Note: You should probably override this allocator if you are calling `parseEx`. Unlike | ||
| 646 | /// `parse`, `parseEx` does not wrap the allocator so the heap allocator can be | ||
| 647 | /// quite expensive. (TODO: Can we pick a better default? For `parse`, this allocator | ||
| 648 | /// is fine, as it wraps it in an arena) | ||
| 649 | allocator: mem.Allocator = heap.page_allocator, | ||
| 650 | diagnostic: ?*Diagnostic = null, | 645 | diagnostic: ?*Diagnostic = null, |
| 651 | }; | 646 | }; |
| 652 | 647 | ||