Permalink
Browse files

Making decompress mem test last longer + plugging memory leaks in com…

…press.cc
  • Loading branch information...
1 parent 3e0bcdb commit 33ccd392c94f9b86dd6724234958578a81902c4b @saikat committed May 7, 2010
Showing with 3 additions and 1 deletion.
  1. +2 −0 compress.cc
  2. +1 −1 test/decompress_memory_test.js
View
@@ -164,6 +164,7 @@ class Gzip : public EventEmitter {
}
Local<Value> outString = Encode(out, out_size, BINARY);
+ free(buf);
free(out);
return scope.Close(outString);
}
@@ -339,6 +340,7 @@ class Gunzip : public EventEmitter {
int r = gunzip->GunzipInflate(buf, len, &out, &out_size);
Local<Value> outString = Encode(out, out_size, enc);
+ free(buf);
free(out);
return scope.Close(outString);
}
@@ -6,7 +6,7 @@ var unzippedValue = fs.readFileSync('files/testfile', 'binary');
var data = fs.readFileSync('files/testfile.gz', 'binary');
// Check your memory usage for the node process while running this test!
-for (var i = 0; i < 1000; i++)
+for (var i = 0; i < 10000; i++)
{
gunzip.init();
var val = gunzip.inflate(data) + gunzip.end();

0 comments on commit 33ccd39

Please sign in to comment.