SQLite

Check-in [a60c545f25]
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
Timelines: family | ancestors | descendants | both | winPreCache
Files: files | file ages | folders
SHA1: a60c545f255f7da53e0ebcde8743532b54bafdb6
User & Date: mistachkin 2014-05-08 22:05:30.985
Context
2014-05-08
22:08
Fix a memory leak of the temporary read buffer. (check-in: 37e60d211f user: mistachkin tags: winPreCache)
22:05
Update comments and only include the thread routine when required. (check-in: a60c545f25 user: mistachkin tags: winPreCache)
22:01
Experimental changes to pre-cache a database file prior to it being fully opened. (check-in: 38cbcedbb6 user: mistachkin tags: winPreCache)
Changes
Unified Diff 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
*/
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;







>

|
|
|







3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
*/
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;
3278
3279
3280
3281
3282
3283
3284

3285
3286
3287
3288
3289
3290
3291
    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.
*/







>







3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
    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.
*/