/ Check-in [a60c545f]
Login

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

Overview
Comment:Update comments and only include the thread routine when required.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | winPreCache
Files: files | file ages | folders
SHA1:a60c545f255f7da53e0ebcde8743532b54bafdb6
User & Date: mistachkin 2014-05-08 22:05:30
Context
2014-05-08
22:08
Fix a memory leak of the temporary read buffer. check-in: 37e60d21 user: mistachkin tags: winPreCache
22:05
Update comments and only include the thread routine when required. check-in: a60c545f user: mistachkin tags: winPreCache
22:01
Experimental changes to pre-cache a database file prior to it being fully opened. check-in: 38cbcedb user: mistachkin tags: winPreCache
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

3207
3208
3209
3210
3211
3212
3213

3214
3215

3216
3217
3218
3219
3220
3221
3222
3223
3224
....
3278
3279
3280
3281
3282
3283
3284

3285
3286
3287
3288
3289
3290
3291
*/
static int winDeviceCharacteristics(sqlite3_file *id){
  winFile *p = (winFile*)id;
  return SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN |
         ((p->ctrlFlags & WINFILE_PSOW)?SQLITE_IOCAP_POWERSAFE_OVERWRITE:0);
}


/*
** Thread routine that seeks to the end of an open file and reads one byte.

** This is used to provide a hint to the operating system that the entire
** file should be held in the cache.
*/
static void *winPreCacheThread(void *pCtx){
  winFile *pFile = (winFile*)pCtx;
  void *pBuf = 0;
  DWORD lastErrno;
  HANDLE dupHandle = NULL;
  DWORD dwSize, dwRet;
................................................................................
    if( dwSize==0 ){
      break;
    }
  }
  osCloseHandle(dupHandle);
  return SQLITE_OK;
}


/* 
** Windows will only let you create file view mappings
** on allocation size granularity boundaries.
** During sqlite3_os_init() we do a GetSystemInfo()
** to get the granularity size.
*/







>

<
>
|
|







 







>







3207
3208
3209
3210
3211
3212
3213
3214
3215

3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
....
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
*/
static int winDeviceCharacteristics(sqlite3_file *id){
  winFile *p = (winFile*)id;
  return SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN |
         ((p->ctrlFlags & WINFILE_PSOW)?SQLITE_IOCAP_POWERSAFE_OVERWRITE:0);
}

#if SQLITE_MAX_WORKER_THREADS>0
/*

** Thread routine that attempts to read the entire file.  This is used to
** provide a hint to the operating system that the entire file should be held
** in the cache.
*/
static void *winPreCacheThread(void *pCtx){
  winFile *pFile = (winFile*)pCtx;
  void *pBuf = 0;
  DWORD lastErrno;
  HANDLE dupHandle = NULL;
  DWORD dwSize, dwRet;
................................................................................
    if( dwSize==0 ){
      break;
    }
  }
  osCloseHandle(dupHandle);
  return SQLITE_OK;
}
#endif

/* 
** Windows will only let you create file view mappings
** on allocation size granularity boundaries.
** During sqlite3_os_init() we do a GetSystemInfo()
** to get the granularity size.
*/