Changeset 90850 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- Aug 24, 2021 2:20:49 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/log/log.cpp
r90847 r90850 91 91 92 92 /** The default buffer size. */ 93 #define RTLOG_BUFFER_DEFAULT_SIZE _64K 93 #ifdef IN_RING0 94 # define RTLOG_BUFFER_DEFAULT_SIZE _64K 95 #else 96 # define RTLOG_BUFFER_DEFAULT_SIZE _128K 97 #endif 94 98 /** Buffer alignment used RTLogCreateExV. */ 95 99 #define RTLOG_BUFFER_ALIGN 64 … … 4587 4591 cb = cbBuf - offBuf - 1; 4588 4592 } 4589 else if (cb <= 2) /* 2 4593 else if (cb <= 2) /* 2 - Make sure we can write a \r\n and not loop forever. */ 4590 4594 { 4591 4595 rtlogFlush(pLoggerInt, true /*fNeedSpace*/); … … 4601 4605 if (pszNewLine) 4602 4606 { 4607 cb = pszNewLine - pachChars; 4603 4608 if (!(pLoggerInt->fFlags & RTLOGFLAGS_USECRLF)) 4604 4609 { 4605 cb = pszNewLine - pachChars +1;4610 cb += 1; 4606 4611 memcpy(&pchBuf[offBuf], pachChars, cb); 4607 4612 pLoggerInt->fPendingPrefix = true; 4608 4613 } 4609 else if ( (uintptr_t)(pszNewLine - pachChars)+ 2U < cbBuf - offBuf)4614 else if (cb + 2U < cbBuf - offBuf) 4610 4615 { 4611 cb = pszNewLine - pachChars;4612 4616 memcpy(&pchBuf[offBuf], pachChars, cb); 4613 4617 pchBuf[offBuf + cb++] = '\r'; … … 4621 4625 { 4622 4626 /* Insufficient buffer space, leave the '\n' for the next iteration. */ 4623 cb = pszNewLine - pachChars;4624 4627 memcpy(&pchBuf[offBuf], pachChars, cb); 4625 4628 }
Note:
See TracChangeset
for help on using the changeset viewer.