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

Side by Side Diff: src/interface.cc

Issue 156643002: Fixed space leak in Interface class. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 this->Print(Nesting::current()); 82 this->Print(Nesting::current());
83 PrintF("%*s%s : ", Nesting::current(), "", 83 PrintF("%*s%s : ", Nesting::current(), "",
84 (*static_cast<String**>(name))->ToAsciiArray()); 84 (*static_cast<String**>(name))->ToAsciiArray());
85 interface->Print(Nesting::current()); 85 interface->Print(Nesting::current());
86 } 86 }
87 #endif 87 #endif
88 88
89 ZoneHashMap** map = &Chase()->exports_; 89 ZoneHashMap** map = &Chase()->exports_;
90 ZoneAllocationPolicy allocator(zone); 90 ZoneAllocationPolicy allocator(zone);
91 91
92 if (*map == NULL) 92 if (*map == NULL) {
93 *map = new ZoneHashMap(Match, ZoneHashMap::kDefaultHashMapCapacity, 93 *map = new(zone->New(sizeof(ZoneHashMap)))
94 allocator); 94 ZoneHashMap(Match, ZoneHashMap::kDefaultHashMapCapacity, allocator);
95 }
95 96
96 ZoneHashMap::Entry* p = (*map)->Lookup(name, hash, !IsFrozen(), allocator); 97 ZoneHashMap::Entry* p = (*map)->Lookup(name, hash, !IsFrozen(), allocator);
97 if (p == NULL) { 98 if (p == NULL) {
98 // This didn't have name but was frozen already, that's an error. 99 // This didn't have name but was frozen already, that's an error.
99 *ok = false; 100 *ok = false;
100 } else if (p->value == NULL) { 101 } else if (p->value == NULL) {
101 p->value = interface; 102 p->value = interface;
102 } else { 103 } else {
103 #ifdef DEBUG 104 #ifdef DEBUG
104 Nesting nested; 105 Nesting nested;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 PrintF("%*s%s : ", n0 + 2, "", name->ToAsciiArray()); 236 PrintF("%*s%s : ", n0 + 2, "", name->ToAsciiArray());
236 interface->Print(n0 + 2); 237 interface->Print(n0 + 2);
237 } 238 }
238 PrintF("%*s}\n", n0, ""); 239 PrintF("%*s}\n", n0, "");
239 } 240 }
240 } 241 }
241 } 242 }
242 #endif 243 #endif
243 244
244 } } // namespace v8::internal 245 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698