From 8472a55b0c8697a60529ba5cd9aeec42598e81dc Mon Sep 17 00:00:00 2001 From: "svenpanne@chromium.org" Date: Thu, 6 Feb 2014 10:23:22 +0000 Subject: [PATCH] Fixed space leak in Interface class. The exports_ hash map itself should live in the zone, too, not only its entries. R=rossberg@chromium.org Review URL: https://codereview.chromium.org/156643002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19138 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/interface.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/interface.cc b/src/interface.cc index 603dfe9..c39d50e 100644 --- a/src/interface.cc +++ b/src/interface.cc @@ -89,9 +89,10 @@ void Interface::DoAdd( ZoneHashMap** map = &Chase()->exports_; ZoneAllocationPolicy allocator(zone); - if (*map == NULL) - *map = new ZoneHashMap(Match, ZoneHashMap::kDefaultHashMapCapacity, - allocator); + if (*map == NULL) { + *map = new(zone->New(sizeof(ZoneHashMap))) + ZoneHashMap(Match, ZoneHashMap::kDefaultHashMapCapacity, allocator); + } ZoneHashMap::Entry* p = (*map)->Lookup(name, hash, !IsFrozen(), allocator); if (p == NULL) { -- 2.7.4