summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfsfileengine_p.h
diff options
context:
space:
mode:
authorJoão Abecasis <joao@abecasis.name>2009-10-07 17:42:39 +0200
committerJoão Abecasis <joao@abecasis.name>2009-10-21 13:46:06 +0200
commit512c2284cafb3eb23d06fc5cdc4e424b711a04b7 (patch)
tree01ca4c0a62e14d1e7e28d89ec7fcc7aa7f4a0610 /src/corelib/io/qfsfileengine_p.h
parent0689a85ca20a36808b388efc452892606d47b34d (diff)
(Windows) Don't create a file mapping for each view that is mapped
Creating a file mapping for each view mapped to memory is sub-optimal and slow. With this change, a single mapping is created and reused when mapping subsequent views of the file. The handle returned from CreateFileForMapping (used in WinCE 5) is now discarded, since the kernel manages it automatically with the file mapping. This simplifies use of the deprecated map API. Reviewed-by: Maurice Kalinowski Reviewed-by: Marius Storm-Olsen
Diffstat (limited to 'src/corelib/io/qfsfileengine_p.h')
-rw-r--r--src/corelib/io/qfsfileengine_p.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/corelib/io/qfsfileengine_p.h b/src/corelib/io/qfsfileengine_p.h
index ee127c1313..87f0737c1e 100644
--- a/src/corelib/io/qfsfileengine_p.h
+++ b/src/corelib/io/qfsfileengine_p.h
@@ -110,7 +110,8 @@ public:
FILE *fh;
#ifdef Q_WS_WIN
HANDLE fileHandle;
- QHash<uchar *, QPair<int /*offset*/, HANDLE /*handle*/> > maps;
+ HANDLE mapHandle;
+ QHash<uchar *, DWORD /* offset % AllocationGranularity */> maps;
mutable int cachedFd;
mutable DWORD fileAttrib;
#else
@@ -119,11 +120,6 @@ public:
#endif
int fd;
-#ifdef Q_USE_DEPRECATED_MAP_API
- void mapHandleClose();
- HANDLE fileMapHandle;
-#endif
-
enum LastIOCommand
{
IOFlushCommand,