/ Check-in [f57a9c91]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Do not unmap the mapped file region in winTruncate as there may be outstanding pointers to it.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | experimental-mmap
Files: files | file ages | folders
SHA1: f57a9c91e993f76ce8b923e06e721414980e8e61
User & Date: mistachkin 2013-03-23 10:09:46
Context
2013-03-23
12:15
In the winMremap VFS function, unmap the region prior to attempting to truncate the file. check-in: 8870c4cc user: mistachkin tags: experimental-mmap
10:09
Do not unmap the mapped file region in winTruncate as there may be outstanding pointers to it. check-in: f57a9c91 user: mistachkin tags: experimental-mmap
09:56
Preliminary changes to support the xMremap VFS method on Windows. check-in: 75a85a1c user: mistachkin tags: experimental-mmap
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
  DWORD lastErrno;

  assert( pFile );

  OSTRACE(("TRUNCATE %d %lld\n", pFile->h, nByte));
  SimulateIOError(return SQLITE_IOERR_TRUNCATE);

  rc = winUnmap(id);
  if( rc!=SQLITE_OK ) return rc;

  /* If the user has configured a chunk-size for this file, truncate the
  ** file so that it consists of an integer number of chunks (i.e. the
  ** actual file size after the operation may be larger than the requested
  ** size).
  */
  if( pFile->szChunk>0 ){
    nByte = ((nByte + pFile->szChunk - 1)/pFile->szChunk) * pFile->szChunk;







<
<
<







2266
2267
2268
2269
2270
2271
2272



2273
2274
2275
2276
2277
2278
2279
  DWORD lastErrno;

  assert( pFile );

  OSTRACE(("TRUNCATE %d %lld\n", pFile->h, nByte));
  SimulateIOError(return SQLITE_IOERR_TRUNCATE);




  /* If the user has configured a chunk-size for this file, truncate the
  ** file so that it consists of an integer number of chunks (i.e. the
  ** actual file size after the operation may be larger than the requested
  ** size).
  */
  if( pFile->szChunk>0 ){
    nByte = ((nByte + pFile->szChunk - 1)/pFile->szChunk) * pFile->szChunk;