/ Check-in [ad5fdfba]
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:Add a compile-time constant for configuring the default pagecache setup.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | pcache-bulk-local
Files: files | file ages | folders
SHA1: ad5fdfbac85682f0f0dee62e1086f40026a58be2
User & Date: drh 2015-07-07 21:14:42
Context
2015-07-08
01:22
Avoid left-shifting bits into the sign of a signed integer, as such behavior is technically undefined. check-in: 9417b402 user: drh tags: pcache-bulk-local
2015-07-07
21:14
Add a compile-time constant for configuring the default pagecache setup. check-in: ad5fdfba user: drh tags: pcache-bulk-local
15:14
No need to test sqlite3GlobalConfig.bCoreMutex when SQLITE_THREADSAFE==0. check-in: 26db0fee user: drh tags: pcache-bulk-local
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/global.c.

   182    182      SQLITE_DEFAULT_MMAP_SIZE,  /* szMmap */
   183    183      SQLITE_MAX_MMAP_SIZE,      /* mxMmap */
   184    184      (void*)0,                  /* pScratch */
   185    185      0,                         /* szScratch */
   186    186      0,                         /* nScratch */
   187    187      (void*)0,                  /* pPage */
   188    188      0,                         /* szPage */
   189         -   100,                       /* nPage */
          189  +   SQLITE_DEFAULT_PCACHE_INITSZ, /* nPage */
   190    190      0,                         /* mxParserStack */
   191    191      0,                         /* sharedCacheEnabled */
   192    192      SQLITE_SORTER_PMASZ,       /* szPma */
   193    193      /* All the rest should always be initialized to zero */
   194    194      0,                         /* isInit */
   195    195      0,                         /* inProgress */
   196    196      0,                         /* isMutexInit */

Changes to src/sqliteInt.h.

   505    505   # define SQLITE_DEFAULT_WORKER_THREADS 0
   506    506   #endif
   507    507   #if SQLITE_DEFAULT_WORKER_THREADS>SQLITE_MAX_WORKER_THREADS
   508    508   # undef SQLITE_MAX_WORKER_THREADS
   509    509   # define SQLITE_MAX_WORKER_THREADS SQLITE_DEFAULT_WORKER_THREADS
   510    510   #endif
   511    511   
          512  +/*
          513  +** The default initial allocation for the pagecache when using separate
          514  +** pagecaches for each database connection.  A positive number is the
          515  +** number of pages.  A negative number N translations means that a buffer
          516  +** of -1024*N bytes is allocated and used for as many pages as it will hold.
          517  +*/
          518  +#ifndef SQLITE_DEFAULT_PCACHE_INITSZ
          519  +# define SQLITE_DEFAULT_PCACHE_INITSZ 100
          520  +#endif
          521  +
   512    522   
   513    523   /*
   514    524   ** GCC does not define the offsetof() macro so we'll have to do it
   515    525   ** ourselves.
   516    526   */
   517    527   #ifndef offsetof
   518    528   #define offsetof(STRUCTURE,FIELD) ((int)((char*)&((STRUCTURE*)0)->FIELD))