summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorLibravatar Eric Wong <normalperson@yhbt.net>2007-01-31 05:13:30 -0800
committerLibravatar Eric Wong <normalperson@yhbt.net>2007-02-23 00:57:11 -0800
commit47a0b75e01876b6e138d78c9504eebedd45c1283 (patch)
tree54f794e06e5eb7d2c1c3b91b2c27ac6f66749dd9 /git-svn.perl
parentgit-svn: make (multi-)fetch safer but slower (diff)
downloadtgif-47a0b75e01876b6e138d78c9504eebedd45c1283.tar.xz
git-svn: avoid a huge memory spike with high-numbered revisions
Passing very large strings as arguments is bad for memory usage as it never seems to get freed in Perl. The .rev_db format is already not optimized for projects with sparse history. Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl5
1 files changed, 3 insertions, 2 deletions
diff --git a/git-svn.perl b/git-svn.perl
index efc5515663..ddb0382608 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1345,8 +1345,9 @@ sub rev_db_set {
seek $fh, 0, 2 or croak $!;
my $pos = tell $fh;
if ($pos < $offset) {
- print $fh (('0' x 40),"\n") x (($offset - $pos) / 41)
- or croak $!;
+ for (1 .. (($offset - $pos) / 41)) {
+ print $fh (('0' x 40),"\n") or croak $!;
+ }
}
seek $fh, $offset, 0 or croak $!;
print $fh $commit,"\n" or croak $!;