1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 02:51:27 +00:00

Deprecate and remove NEWZERO macro

This commit is contained in:
2013-01-04 21:32:48 -08:00
parent b574a583f4
commit bc0d04da48
55 changed files with 455 additions and 385 deletions

View File

@ -108,12 +108,19 @@ struct Operation {
unsigned pending;
CNtWaitHandle * signalComplete;
LINK(Operation) link;
Operation()
: opType((EOpType)0), asyncId(nil), notify(false), pending(0),
signalComplete(nil)
{
memset(&overlapped, 0, sizeof(overlapped));
}
#ifdef HS_DEBUGGING
~Operation () {
ASSERT(!signalComplete);
}
#endif
#endif
};
struct NtObject {
@ -126,6 +133,11 @@ struct NtObject {
long nextStartSequence;
long ioCount;
bool closed;
NtObject()
: ioType((EIoType)0), handle(nil), userState(nil),
nextCompleteSequence(0), nextStartSequence(0),
ioCount(0), closed(false) { }
};

View File

@ -105,6 +105,8 @@ struct NtOpSocketWrite : Operation {
unsigned queueTimeMs;
unsigned bytesAlloc;
AsyncNotifySocketWrite write;
NtOpSocketWrite() : queueTimeMs(0), bytesAlloc(0) { }
};
struct NtOpSocketRead : Operation {
@ -121,7 +123,7 @@ struct NtSock : NtObject {
NtOpSocketRead opRead;
unsigned backlogAlloc;
unsigned initTimeMs;
uint8_t buffer[kAsyncSocketBufferSize];
uint8_t buffer[kAsyncSocketBufferSize];
NtSock ();
~NtSock ();
@ -144,7 +146,12 @@ static LISTDECL(NtSock, link) s_socketList;
//===========================================================================
inline NtSock::NtSock () {
inline NtSock::NtSock ()
: closeTimeMs(0), connType(0), notifyProc(nil), bytesLeft(0)
, backlogAlloc(0), initTimeMs(0)
{
memset(buffer, 0, sizeof(buffer));
PerfAddCounter(kAsyncPerfSocketsCurr, 1);
PerfAddCounter(kAsyncPerfSocketsTotal, 1);
}
@ -406,7 +413,7 @@ static NtSock * SocketInitCommon (SOCKET hSocket) {
LogMsg(kLogError, "setsockopt(recv) failed (set recv buffer size)");
// allocate a new socket
NtSock * sock = NEWZERO(NtSock);
NtSock * sock = new NtSock;
sock->ioType = kNtSocket;
sock->handle = (HANDLE) hSocket;
sock->initTimeMs = TimeGetMs();