/ Check-in [5cd9ff87]
Login

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

Overview
Comment:Avoid unnecessary mutexes in the pcache1 implementation in the common case where no auxiliary page cache memory is configured.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | begin-concurrent-branch-3.19
Files: files | file ages | folders
SHA3-256: 5cd9ff87d8aa62ad97ad64b580e042b82477f6fd7b6dde1b4de7a050023c80c5
User & Date: drh 2017-08-28 17:30:34
Context
2017-08-28
17:32
Add the --enable-update-limit option to the ./configure script. Leaf check-in: f545db6c user: drh tags: begin-concurrent-branch-3.19
17:30
Avoid unnecessary mutexes in the pcache1 implementation in the common case where no auxiliary page cache memory is configured. check-in: 5cd9ff87 user: drh tags: begin-concurrent-branch-3.19
17:26
Remove the rarely-used scratch memory allocator. This makes the code smaller, faster, and easier to maintain. In place of the scratch allocator, add the SQLITE_CONFIG_SMALL_MALLOC configuration option that provides a hint to SQLite that large memory allocations should be avoided. check-in: cc440400 user: drh tags: begin-concurrent-branch-3.19
16:11
Avoid unnecessary mutexes in the pcache1 implementation in the common case where no auxiliary page cache memory is configured. check-in: 1ba051e3 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pcache1.c.

   241    241   ** This routine is called from sqlite3_initialize() and so it is guaranteed
   242    242   ** to be serialized already.  There is no need for further mutexing.
   243    243   */
   244    244   void sqlite3PCacheBufferSetup(void *pBuf, int sz, int n){
   245    245     if( pcache1.isInit ){
   246    246       PgFreeslot *p;
   247    247       if( pBuf==0 ) sz = n = 0;
          248  +    if( n==0 ) sz = 0;
   248    249       sz = ROUNDDOWN8(sz);
   249    250       pcache1.szSlot = sz;
   250    251       pcache1.nSlot = pcache1.nFreeSlot = n;
   251    252       pcache1.nReserve = n>90 ? 10 : (n/10 + 1);
   252    253       pcache1.pStart = pBuf;
   253    254       pcache1.pFree = 0;
   254    255       pcache1.bUnderPressure = 0;