Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(469)

Unified Diff: test/cctest/test-serialize.cc

Issue 4095009: Fix some memory leaks in the serialization tests. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-serialize.cc
===================================================================
--- test/cctest/test-serialize.cc (revision 5724)
+++ test/cctest/test-serialize.cc (working copy)
@@ -216,6 +216,7 @@
Vector<char> name = Vector<char>::New(file_name_length + 1);
OS::SNPrintF(name, "%s.size", file_name_);
FILE* fp = OS::FOpen(name.start(), "w");
+ name.Dispose();
fprintf(fp, "new %d\n", new_space_used);
fprintf(fp, "pointer %d\n", pointer_space_used);
fprintf(fp, "data %d\n", data_space_used);
@@ -381,6 +382,7 @@
env.Dispose();
FileByteSink startup_sink(startup_name.start());
+ startup_name.Dispose();
StartupSerializer startup_serializer(&startup_sink);
startup_serializer.SerializeStrongReferences();
@@ -403,6 +405,7 @@
Vector<char> name = Vector<char>::New(file_name_length + 1);
OS::SNPrintF(name, "%s.size", file_name);
FILE* fp = OS::FOpen(name.start(), "r");
+ name.Dispose();
int new_size, pointer_size, data_size, code_size, map_size, cell_size;
int large_size;
#ifdef _MSC_VER
@@ -438,6 +441,7 @@
OS::SNPrintF(startup_name, "%s.startup", FLAG_testing_serialization_file);
CHECK(Snapshot::Initialize(startup_name.start()));
+ startup_name.Dispose();
const char* file_name = FLAG_testing_serialization_file;
ReserveSpaceForPartialSnapshot(file_name);
@@ -495,6 +499,7 @@
env.Dispose();
FileByteSink startup_sink(startup_name.start());
+ startup_name.Dispose();
StartupSerializer startup_serializer(&startup_sink);
startup_serializer.SerializeStrongReferences();
@@ -519,6 +524,7 @@
OS::SNPrintF(startup_name, "%s.startup", FLAG_testing_serialization_file);
CHECK(Snapshot::Initialize(startup_name.start()));
+ startup_name.Dispose();
const char* file_name = FLAG_testing_serialization_file;
ReserveSpaceForPartialSnapshot(file_name);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698