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

Overview
Comment:Fix memory leaks in test suite.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f4d0f555717b8f5add378ba707df3718000c62a7
User & Date: dan 2014-02-14 18:53:12.350
Context
2014-02-15
17:04
Add some human readable text to the bt file header. Refuse to open a database (SQLITE_NOTADB) if a valid header cannot be located in the database or wal files. check-in: b942b91a3d user: dan tags: trunk
2014-02-14
18:53
Fix memory leaks in test suite. check-in: f4d0f55571 user: dan tags: trunk
16:21
Run extra tests with the bt backend. check-in: 1aefe7ef1e user: dan tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/bt_log.c.
635
636
637
638
639
640
641

642
643
644
645
646
647
648
    if( rc==SQLITE4_OK ){
      rc = xFrame(pLog, pCtx, iFrame, &fhdr);
    }

    iFrame = fhdr.iNext;
  }


  return rc;
}

/*
** Locate the iHash'th hash table in shared memory. Return it.
*/
static int btLogFindHash(







>







635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
    if( rc==SQLITE4_OK ){
      rc = xFrame(pLog, pCtx, iFrame, &fhdr);
    }

    iFrame = fhdr.iNext;
  }

  sqlite4_free(pEnv, aBuf);
  return rc;
}

/*
** Locate the iHash'th hash table in shared memory. Return it.
*/
static int btLogFindHash(
Changes to src/kvmem.c.
631
632
633
634
635
636
637
638
639
640
641
642


643
644
645
646
647
648
649
        }else{
          pNode->pAfter = pNew = kvmemNewNode(p, aKey, nKey);
          if( pNew==0 ) goto KVMemReplace_nomem;
          pNew->pUp = pNode;
          break;
        }
      }else{
        if( pNode->mxTrans==p->base.iTransLevel ){
          kvmemDataUnref(p->base.pEnv, pNode->pData);
        }else if( kvmemTransactional(p) ){
          pChng = kvmemNewChng(p, pNode);
          if( pChng==0 ) goto KVMemReplace_nomem;


        }
        pNode->pData = pData;
        return SQLITE4_OK;
      }
    }
  }
  pNew->pData = pData;







<
<
|


>
>







631
632
633
634
635
636
637


638
639
640
641
642
643
644
645
646
647
648
649
        }else{
          pNode->pAfter = pNew = kvmemNewNode(p, aKey, nKey);
          if( pNew==0 ) goto KVMemReplace_nomem;
          pNew->pUp = pNode;
          break;
        }
      }else{


        if( kvmemTransactional(p) && pNode->mxTrans!=p->base.iTransLevel ){
          pChng = kvmemNewChng(p, pNode);
          if( pChng==0 ) goto KVMemReplace_nomem;
        }else{
          kvmemDataUnref(p->base.pEnv, pNode->pData);
        }
        pNode->pData = pData;
        return SQLITE4_OK;
      }
    }
  }
  pNew->pData = pData;
837
838
839
840
841
842
843

844
845
846
847
848
849
850
  assert( pCur->iMagicKVMemCur==SQLITE4_KVMEMCUR_MAGIC );
  p = pCur->pOwner;
  assert( p->iMagicKVMemBase==SQLITE4_KVMEMBASE_MAGIC );
  assert( p->base.iTransLevel>=2 );
  pNode = pCur->pNode;
  if( pNode==0 ) return SQLITE4_OK;
  if( !kvmemTransactional(p) ){

    pCur->pNode = 0;
    kvmemRemoveNode(p, pNode);
  }else if( pNode->pData==0 ){
    /* no-op */
  }else if( pNode->mxTrans<p->base.iTransLevel ){
    pChng = kvmemNewChng(p, pNode);
    if( pChng==0 ) return SQLITE4_NOMEM;







>







837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
  assert( pCur->iMagicKVMemCur==SQLITE4_KVMEMCUR_MAGIC );
  p = pCur->pOwner;
  assert( p->iMagicKVMemBase==SQLITE4_KVMEMBASE_MAGIC );
  assert( p->base.iTransLevel>=2 );
  pNode = pCur->pNode;
  if( pNode==0 ) return SQLITE4_OK;
  if( !kvmemTransactional(p) ){
    kvmemNodeUnref(p->base.pEnv, pNode);
    pCur->pNode = 0;
    kvmemRemoveNode(p, pNode);
  }else if( pNode->pData==0 ){
    /* no-op */
  }else if( pNode->mxTrans<p->base.iTransLevel ){
    pChng = kvmemNewChng(p, pNode);
    if( pChng==0 ) return SQLITE4_NOMEM;
Changes to tool/mtv.tcl.
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281

  mddb function lrange -argcount 3 lrange
  mddb function llength -argcount 1 llength
  mddb function trim_frames -argcount 1 trim_frames

  mddb eval {
    SELECT frame FROM frame 
    WHERE line LIKE '%mem.c:%' 
    OR function LIKE '%Malloc'
    OR function LIKE '%MallocRaw'
    OR function LIKE '%MallocZero'
    OR function LIKE '%Realloc'
  } {
    set ::O(ignore.$frame) 1
  }







|







267
268
269
270
271
272
273
274
275
276
277
278
279
280
281

  mddb function lrange -argcount 3 lrange
  mddb function llength -argcount 1 llength
  mddb function trim_frames -argcount 1 trim_frames

  mddb eval {
    SELECT frame FROM frame 
    WHERE (line LIKE '%mem.c:%' AND line NOT LIKE '%kvmem.c:%')
    OR function LIKE '%Malloc'
    OR function LIKE '%MallocRaw'
    OR function LIKE '%MallocZero'
    OR function LIKE '%Realloc'
  } {
    set ::O(ignore.$frame) 1
  }