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

Unified Diff: runtime/bin/eventhandler_win.cc

Issue 12935002: Change the IO buffer size on Windows to 32k (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/eventhandler_win.cc
diff --git a/runtime/bin/eventhandler_win.cc b/runtime/bin/eventhandler_win.cc
index cb193a640ae6145aea6ebf7c0c87275473572ffd..9e31485a6f4b05d89a309d6df86bbb2d18f5ebef 100644
--- a/runtime/bin/eventhandler_win.cc
+++ b/runtime/bin/eventhandler_win.cc
@@ -20,6 +20,8 @@
#include "platform/thread.h"
+#define BUFFER_SIZE 32 * 1024
Mads Ager (google) 2013/03/19 15:11:20 Please use a constant as below. static const int
Søren Gjesse 2013/03/19 15:26:48 Done.
+
static const int kInfinityTimeout = -1;
static const int kTimeoutId = -1;
static const int kShutdownId = -2;
@@ -234,7 +236,7 @@ bool Handle::IssueRead() {
ScopedLock lock(this);
ASSERT(type_ != kListenSocket);
ASSERT(pending_read_ == NULL);
- IOBuffer* buffer = IOBuffer::AllocateReadBuffer(1024);
+ IOBuffer* buffer = IOBuffer::AllocateReadBuffer(BUFFER_SIZE);
if (SupportsOverlappedIO()) {
ASSERT(completion_port_ != INVALID_HANDLE_VALUE);
@@ -491,7 +493,7 @@ int Handle::Write(const void* buffer, int num_bytes) {
if (SupportsOverlappedIO()) {
if (pending_write_ != NULL) return 0;
if (completion_port_ == INVALID_HANDLE_VALUE) return 0;
- if (num_bytes > 4096) num_bytes = 4096;
+ if (num_bytes > BUFFER_SIZE) num_bytes = BUFFER_SIZE;
pending_write_ = IOBuffer::AllocateWriteBuffer(num_bytes);
pending_write_->Write(buffer, num_bytes);
if (!IssueWrite()) return -1;
« 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