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

Issue 7660016: Fix memory leaks in ~Zone and ~Isolate (Closed)

Created:
9 years, 4 months ago by Jakob Kummerow
Modified:
9 years, 4 months ago
Reviewers:
Vitaly Repeshko
CC:
v8-dev
Visibility:
Public.

Description

Fix memory leaks in ~Zone and ~Isolate TEST=chromium valgrind bots Committed: http://code.google.com/p/v8/source/detail?r=8949

Patch Set 1 #

Total comments: 6

Patch Set 2 : addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+96 lines, -73 lines) Patch
M src/isolate.cc View 1 2 chunks +6 lines, -0 lines 0 comments Download
M src/serialize.h View 1 chunk +46 lines, -0 lines 0 comments Download
M src/serialize.cc View 1 chunk +8 lines, -50 lines 0 comments Download
M src/zone.h View 1 1 chunk +5 lines, -1 line 0 comments Download
M src/zone.cc View 1 4 chunks +31 lines, -22 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Jakob Kummerow
PTAL. The actual change is minimal: I simply put a "delete" operator, guarded by a ...
9 years, 4 months ago (2011-08-16 17:01:46 UTC) #1
Vitaly Repeshko
LGTM with comments addressed. http://codereview.chromium.org/7660016/diff/1/src/isolate.cc File src/isolate.cc (right): http://codereview.chromium.org/7660016/diff/1/src/isolate.cc#newcode1594 src/isolate.cc:1594: if (external_reference_table_ != NULL) { ...
9 years, 4 months ago (2011-08-16 17:52:30 UTC) #2
Jakob Kummerow
9 years, 4 months ago (2011-08-17 08:47:29 UTC) #3
Comments addressed, landing.

http://codereview.chromium.org/7660016/diff/1/src/isolate.cc
File src/isolate.cc (right):

http://codereview.chromium.org/7660016/diff/1/src/isolate.cc#newcode1594
src/isolate.cc:1594: if (external_reference_table_ != NULL) {
On 2011/08/16 17:52:32, Vitaly Repeshko wrote:
> It's safe to delete NULL. "if" is not necessary.

Done.

http://codereview.chromium.org/7660016/diff/1/src/zone.cc
File src/zone.cc (right):

http://codereview.chromium.org/7660016/diff/1/src/zone.cc#newcode82
src/zone.cc:82: delete segment_head_;
On 2011/08/16 17:52:32, Vitaly Repeshko wrote:
> This should use DeleteSegment.

Done.
This required putting the code into a separate method, because DeleteSegment()
depends on the isolate's counters being alive, but at the time ~Zone() runs
they're already deleted.

http://codereview.chromium.org/7660016/diff/1/src/zone.h
File src/zone.h (right):

http://codereview.chromium.org/7660016/diff/1/src/zone.h#newcode61
src/zone.h:61: ~Zone();
On 2011/08/16 17:52:32, Vitaly Repeshko wrote:
> Given that the constructor is private it makes sense to have the destructor
> private too (if possible).

Done.

Powered by Google App Engine
This is Rietveld 408576698