We parse other options, too, not just --max-size
For L<public-inbox-v2-format(5)> inboxes, this value is
multiplied by the number of Xapian shards. Thus a typical v2
inbox with 3 shards will flush every 3 megabytes by default
-when unless parallelism is disabled via C<--sequential-shard>
+unless parallelism is disabled via C<--sequential-shard>
or C<--jobs=0>.
This influences memory usage of Xapian, but it is not exact.
# same unit factors as git:
sub parse_unsigned ($) {
- my ($max_size) = @_;
+ my ($val) = @_;
- $$max_size =~ /\A([0-9]+)([kmg])?\z/i or return;
+ $$val =~ /\A([0-9]+)([kmg])?\z/i or return;
my ($n, $unit_factor) = ($1, $2 // '');
my %u = ( k => 1024, m => 1024**2, g => 1024**3 );
- $$max_size = $n * ($u{lc($unit_factor)} // 1);
+ $$val = $n * ($u{lc($unit_factor)} // 1);
1;
}