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

Unified Diff: runtime/bin/eventhandler_win.cc

Issue 14589014: Change async read buffer sizes on Windows (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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/eventhandler_win.cc
diff --git a/runtime/bin/eventhandler_win.cc b/runtime/bin/eventhandler_win.cc
index 6a43dd5ea4ae9fac8c6cedf10e6ec51a53027c76..6819fce44ee4fb2a76f0eda7724d23b0de2ea25a 100644
--- a/runtime/bin/eventhandler_win.cc
+++ b/runtime/bin/eventhandler_win.cc
@@ -23,7 +23,8 @@
namespace dart {
namespace bin {
-static const int kBufferSize = 32 * 1024;
+static const int kBufferSize = 64 * 1024;
+static const int kStdioBufferSize = 16 * 1024;
static const int kInfinityTimeout = -1;
static const int kTimeoutId = -1;
@@ -212,10 +213,16 @@ static unsigned int __stdcall ReadFileThread(void* args) {
void Handle::ReadSyncCompleteAsync() {
ASSERT(pending_read_ != NULL);
+ ASSERT(pending_read_->GetBufferSize() >= kStdioBufferSize);
+
+ DWORD buffer_size = pending_read_->GetBufferSize();
+ if (GetFileType(handle_) == FILE_TYPE_CHAR) {
+ buffer_size = kStdioBufferSize;
+ }
DWORD bytes_read = 0;
BOOL ok = ReadFile(handle_,
pending_read_->GetBufferStart(),
- pending_read_->GetBufferSize(),
+ buffer_size,
&bytes_read,
NULL);
if (!ok) {
« 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