Grazvydas Ignotas : msvcrt: Change internal buffer size to 4k.

Alexandre Julliard julliard at winehq.org
Tue Jun 17 14:40:51 CDT 2014


Module: wine
Branch: master
Commit: 40067dd0110f0d7d3e354a89c892a67f4e3ecdc3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=40067dd0110f0d7d3e354a89c892a67f4e3ecdc3

Author: Grazvydas Ignotas <notasas at gmail.com>
Date:   Sat Jun 14 02:23:56 2014 +0300

msvcrt: Change internal buffer size to 4k.

---

 dlls/msvcrt/file.c       |    6 ++++--
 dlls/msvcrt/tests/file.c |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c
index 178f164..c1d9d6e 100644
--- a/dlls/msvcrt/file.c
+++ b/dlls/msvcrt/file.c
@@ -81,6 +81,8 @@ static char utf16_bom[2] = { 0xff, 0xfe };
 #define MSVCRT_MAX_FILES 2048
 #define MSVCRT_FD_BLOCK_SIZE 32
 
+#define MSVCRT_INTERNAL_BUFSIZ 4096
+
 /* ioinfo structure size is different in msvcrXX.dll's */
 typedef struct {
     HANDLE              handle;
@@ -619,9 +621,9 @@ static BOOL msvcrt_alloc_buffer(MSVCRT_FILE* file)
             && MSVCRT__isatty(file->_file))
         return FALSE;
 
-    file->_base = MSVCRT_calloc(MSVCRT_BUFSIZ,1);
+    file->_base = MSVCRT_calloc(MSVCRT_INTERNAL_BUFSIZ,1);
     if(file->_base) {
-        file->_bufsiz = MSVCRT_BUFSIZ;
+        file->_bufsiz = MSVCRT_INTERNAL_BUFSIZ;
         file->_flag |= MSVCRT__IOMYBUF;
     } else {
         file->_base = (char*)(&file->_charbuf);
diff --git a/dlls/msvcrt/tests/file.c b/dlls/msvcrt/tests/file.c
index 00e1f90..c98adf4 100644
--- a/dlls/msvcrt/tests/file.c
+++ b/dlls/msvcrt/tests/file.c
@@ -2269,7 +2269,7 @@ static void test_write_flush(void)
     ok(file != NULL, "unable to create test file\n");
     iobuf[0] = 0;
     fwrite(iobuf, 1, 1, file); /* needed for wine to init _bufsiz */
-    todo_wine ok(file->_bufsiz == 4096, "incorrect default buffer size: %d", file->_bufsiz);
+    ok(file->_bufsiz == 4096, "incorrect default buffer size: %d", file->_bufsiz);
     test_write_flush_size(file, file->_bufsiz);
     setvbuf(file, iobuf, _IOFBF, sizeof(iobuf));
     test_write_flush_size(file, sizeof(iobuf));




More information about the wine-cvs mailing list