From: svenpanne@chromium.org Date: Thu, 6 Feb 2014 10:23:22 +0000 (+0000) Subject: Fixed space leak in Interface class. X-Git-Tag: upstream/4.7.83~10848 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8472a55b0c8697a60529ba5cd9aeec42598e81dc;p=platform%2Fupstream%2Fv8.git 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 --- 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) {