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

Unified Diff: net/base/tcp_client_socket_win.cc

Issue 13331: Add a call to MemoryDebug::MarkAsInitialized to the new network code to avoid... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years 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: net/base/tcp_client_socket_win.cc
===================================================================
--- net/base/tcp_client_socket_win.cc (revision 6529)
+++ net/base/tcp_client_socket_win.cc (working copy)
@@ -4,6 +4,7 @@
#include "net/base/tcp_client_socket.h"
+#include "base/memory_debug.h"
#include "base/string_util.h"
#include "base/trace_event.h"
#include "net/base/net_errors.h"
@@ -175,6 +176,14 @@
BOOL ok = WSAResetEvent(overlapped_.hEvent);
CHECK(ok);
TRACE_EVENT_END("socket.read", this, StringPrintf("%d bytes", num));
+
+ // Because of how WSARecv fills memory when used asynchronously, Purify
+ // isn't able to detect that it's been initialized, so it scans for 0xcd
+ // in the buffer and reports UMRs (uninitialized memory reads) for those
+ // individual bytes. We override that in PURIFY builds to avoid the false
+ // error reports.
+ // See http://code.google.com/p/chromium/issues/detail?id=5297
darin (slow to review) 2008/12/10 17:33:29 Can we use a more abbreviated way of referring to
+ base::MemoryDebug::MarkAsInitialized(buffer_.buf, num);
return static_cast<int>(num);
}
int err = WSAGetLastError();
« 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