/ Check-in [30f86eb3]
Login

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

Overview
Comment:Correct the documentation on the maximum size of a scratch allocation.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 30f86eb3f9ac88f83ed9e23ea6cd1fccf68e0812
User & Date: drh 2014-10-28 00:56:18
Context
2014-10-28
12:35
Bump the version number to 3.8.8 check-in: 1a7e711e user: drh tags: trunk
00:56
Correct the documentation on the maximum size of a scratch allocation. check-in: 30f86eb3 user: drh tags: trunk
2014-10-27
22:06
Add special handling for static mutexes in sqlite3_mutex_alloc() when automatic calls to sqlite3_initialize() are enabled. check-in: 7857d27c user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

  6645   6645     /*
  6646   6646     ** Allocate space for memory structures
  6647   6647     */
  6648   6648     szScratch =
  6649   6649          nMaxCells*sizeof(u8*)                       /* apCell */
  6650   6650        + nMaxCells*sizeof(u16)                       /* szCell */
  6651   6651        + pBt->pageSize;                              /* aSpace1 */
         6652  +  assert( szScratch<=16896 || szScratch<=6*pBt->pageSize );
  6652   6653     apCell = sqlite3ScratchMalloc( szScratch ); 
  6653   6654     if( apCell==0 ){
  6654   6655       rc = SQLITE_NOMEM;
  6655   6656       goto balance_cleanup;
  6656   6657     }
  6657   6658     szCell = (u16*)&apCell[nMaxCells];
  6658   6659     aSpace1 = (u8*)&szCell[nMaxCells];

Changes to src/sqlite.h.in.

  1535   1535   ** scratch memory.  There are three arguments:  A pointer an 8-byte
  1536   1536   ** aligned memory buffer from which the scratch allocations will be
  1537   1537   ** drawn, the size of each scratch allocation (sz),
  1538   1538   ** and the maximum number of scratch allocations (N).  The sz
  1539   1539   ** argument must be a multiple of 16.
  1540   1540   ** The first argument must be a pointer to an 8-byte aligned buffer
  1541   1541   ** of at least sz*N bytes of memory.
  1542         -** ^SQLite will use no more than two scratch buffers per thread.  So
  1543         -** N should be set to twice the expected maximum number of threads.
  1544         -** ^SQLite will never require a scratch buffer that is more than 6
  1545         -** times the database page size. ^If SQLite needs needs additional
         1542  +** ^SQLite will not use more than two scratch buffers per thread and not
         1543  +** more than one scratch buffer per thread when not performing
         1544  +** a [checkpoint] in [WAL mode].
         1545  +** ^SQLite will never request a scratch buffer that is more than 6
         1546  +** times the database page size, except when performing a [checkpoint]
         1547  +** in [WAL mode] when the scratch buffer request size is a small fraction
         1548  +** of the size of the WAL file.
         1549  +** ^If SQLite needs needs additional
  1546   1550   ** scratch memory beyond what is provided by this configuration option, then 
  1547   1551   ** [sqlite3_malloc()] will be used to obtain the memory needed.</dd>
  1548   1552   **
  1549   1553   ** [[SQLITE_CONFIG_PAGECACHE]] <dt>SQLITE_CONFIG_PAGECACHE</dt>
  1550   1554   ** <dd> ^This option specifies a static memory buffer that SQLite can use for
  1551   1555   ** the database page cache with the default page cache implementation.  
  1552   1556   ** This configuration should not be used if an application-define page