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
This commit is contained in:
svenpanne@chromium.org 2014-02-06 10:23:22 +00:00
parent 931fae7d1c
commit 8472a55b0c

View File

@ -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) {