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
parent 931fae7d
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment