Skip to content

Commit

Permalink
Making decompress mem test last longer + plugging memory leaks in com…
Browse files Browse the repository at this point in the history
…press.cc
  • Loading branch information
Saikat Chakrabarti committed May 7, 2010
1 parent 3e0bcdb commit 33ccd39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions compress.cc
Expand Up @@ -164,6 +164,7 @@ class Gzip : public EventEmitter {
}

Local<Value> outString = Encode(out, out_size, BINARY);
free(buf);
free(out);
return scope.Close(outString);
}
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion test/decompress_memory_test.js
Expand Up @@ -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();
Expand Down

0 comments on commit 33ccd39

Please sign in to comment.