Reviewers: danno,

Description:
Valgrind cleanliness, part 1: Delete current isolate on exit.

Currently we leak 140kB from 80 allocation sites when we evaluate a simple
"print(1+2)" in d8 and exit. This might not be a real problem in Chrome because most of the time the whole process containing v8 vanishes, but it can hide real leaks in a sea of false positives. Therefore, this CL and a few subsequent ones
clean this up a bit.

This simple CL alone fixes 45 leaks, leaving only 35 with a net loss of 2192
bytes (on ia32).


Please review this at http://codereview.chromium.org/9791016/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/v8.cc


Index: src/v8.cc
diff --git a/src/v8.cc b/src/v8.cc
index 506f3f66068bb2809d06fd4297d231fe602b20eb..fdc8a90e41e61c869bfcf015b14487252fac8505 100644
--- a/src/v8.cc
+++ b/src/v8.cc
@@ -103,7 +103,9 @@ void V8::TearDown() {
   ASSERT(isolate->IsDefaultIsolate());

   if (!has_been_set_up_ || has_been_disposed_) return;
+
   isolate->TearDown();
+  delete isolate;

   is_running_ = false;
   has_been_disposed_ = true;


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to