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

Unified Diff: runtime/bin/filter.cc

Issue 12812006: Avoid massive stack frames by allocating 64k buffers in the heap. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/filter.cc
diff --git a/runtime/bin/filter.cc b/runtime/bin/filter.cc
index 3515052321aaa0221069f1fabaed5963c42abc1d..19d97de8b2777d0bab0f3858e5f878db9a0690ab 100644
--- a/runtime/bin/filter.cc
+++ b/runtime/bin/filter.cc
@@ -133,11 +133,12 @@ void FUNCTION_NAME(Filter_Processed)(Dart_NativeArguments args) {
Dart_ThrowException(DartUtils::NewInternalError(
"Failed to get 'flush' parameter"));
}
- uint8_t buffer[kFilterBufferLength];
+ uint8_t* buffer = new uint8_t[kFilterBufferLength];
siva 2013/03/15 07:47:00 Not sure how frequently this function is called bu
Mads Ager (google) 2013/03/15 09:24:56 I don't have any data on how often this is called
intptr_t read = filter->Processed(buffer, kFilterBufferLength, flush);
if (read < 0) {
// Error, end filter.
EndFilter(filter_obj, filter);
+ delete[] buffer;
Dart_ThrowException(DartUtils::NewInternalError(
"Filter error, bad data"));
} else if (read == 0) {
@@ -148,6 +149,7 @@ void FUNCTION_NAME(Filter_Processed)(Dart_NativeArguments args) {
memmove(io_buffer, buffer, read);
Dart_SetReturnValue(args, result);
}
+ delete[] buffer;
Dart_ExitScope();
}
« 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