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

Unified Diff: src/log.cc

Issue 1737023: Turn some usages of NewArray with DeleteArray in the same scope into ScopedVector or SmartPointer. (Closed)
Patch Set: Disabling implicit constructors Created 10 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/flags.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log.cc
diff --git a/src/log.cc b/src/log.cc
index e1ebc87c65f6c2526373bda52edb5b3004c20304..891b0e2b8296b428daacbc91654bf780d2e9dd75 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -1313,9 +1313,8 @@ void Logger::LogCodeObjects() {
void Logger::LogCompiledFunctions() {
HandleScope scope;
const int compiled_funcs_count = EnumerateCompiledFunctions(NULL);
- Handle<SharedFunctionInfo>* sfis =
- NewArray< Handle<SharedFunctionInfo> >(compiled_funcs_count);
- EnumerateCompiledFunctions(sfis);
+ ScopedVector< Handle<SharedFunctionInfo> > sfis(compiled_funcs_count);
+ EnumerateCompiledFunctions(sfis.start());
// During iteration, there can be heap allocation due to
// GetScriptLineNumber call.
@@ -1360,8 +1359,6 @@ void Logger::LogCompiledFunctions() {
Logger::LAZY_COMPILE_TAG, shared->code(), *func_name));
}
}
-
- DeleteArray(sfis);
}
« no previous file with comments | « src/flags.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698