/ Check-in [0a9cff5c]
Login

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

Overview
Comment:Small simplification and performance improvement in memsys5Free().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0a9cff5c4822874b74e90bfca3963bc7e5c753a5
User & Date: drh 2016-01-25 01:07:59
Context
2016-01-25
02:15
Small simplification to the prepare statement opcode memory reuse logic. Easier to read, and slightly smaller and faster. check-in: 8a1deae4 user: drh tags: trunk
01:07
Small simplification and performance improvement in memsys5Free(). check-in: 0a9cff5c user: drh tags: trunk
2016-01-23
22:55
Add the SQLITE_SPELLFIX_STACKALLOC_SZ compile-time option to control how much stack space is available for use as the Wagner matrix in editDest3 of the spellfix extension. check-in: dd0100dd user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/mem5.c.

318
319
320
321
322
323
324

325
326

327
328
329
330
331
332
333
334
335
336
#endif

  mem5.aCtrl[iBlock] = CTRL_FREE | iLogsize;
  while( ALWAYS(iLogsize<LOGMAX) ){
    int iBuddy;
    if( (iBlock>>iLogsize) & 1 ){
      iBuddy = iBlock - size;

    }else{
      iBuddy = iBlock + size;

    }
    assert( iBuddy>=0 );
    if( (iBuddy+(1<<iLogsize))>mem5.nBlock ) break;
    if( mem5.aCtrl[iBuddy]!=(CTRL_FREE | iLogsize) ) break;
    memsys5Unlink(iBuddy, iLogsize);
    iLogsize++;
    if( iBuddy<iBlock ){
      mem5.aCtrl[iBuddy] = CTRL_FREE | iLogsize;
      mem5.aCtrl[iBlock] = 0;
      iBlock = iBuddy;







>


>

<
<







318
319
320
321
322
323
324
325
326
327
328
329


330
331
332
333
334
335
336
#endif

  mem5.aCtrl[iBlock] = CTRL_FREE | iLogsize;
  while( ALWAYS(iLogsize<LOGMAX) ){
    int iBuddy;
    if( (iBlock>>iLogsize) & 1 ){
      iBuddy = iBlock - size;
      assert( iBuddy>=0 );
    }else{
      iBuddy = iBlock + size;
      if( iBuddy>=mem5.nBlock ) break;
    }


    if( mem5.aCtrl[iBuddy]!=(CTRL_FREE | iLogsize) ) break;
    memsys5Unlink(iBuddy, iLogsize);
    iLogsize++;
    if( iBuddy<iBlock ){
      mem5.aCtrl[iBuddy] = CTRL_FREE | iLogsize;
      mem5.aCtrl[iBlock] = 0;
      iBlock = iBuddy;