/ Check-in [ef0e40e8]
Login

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

Overview
Comment:Fix for memory leak in malloc3.test. (CVS 4913)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ef0e40e814b3d3a00721f8ca39bac0db1be24347
User & Date: danielk1977 2008-03-25 09:56:45
Context
2008-03-25
14:24
Have each {quote: BtShared} structure hang on to a buffer of just under page-size bytes for temporary use. This reduces the number of calls to malloc(). (CVS 4914) check-in: fe1bc0f3 user: danielk1977 tags: trunk
09:56
Fix for memory leak in malloc3.test. (CVS 4913) check-in: ef0e40e8 user: danielk1977 tags: trunk
09:47
Use a vdbe memory cell to allocate the space required for vdbe cursors. (CVS 4912) check-in: 04715364 user: danielk1977 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/btree.c.

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
....
3640
3641
3642
3643
3644
3645
3646
3647



3648
3649
3650
3651
3652
3653
3654
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.444 2008/03/25 09:47:35 danielk1977 Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
** Including a description of file format and an overview of operation.
*/
#include "btreeInt.h"

................................................................................
        int available;
        pCellKey = (void *)fetchPayload(pCur, &available, 0);
        nCellKey = pCur->info.nKey;
        if( available>=nCellKey ){
          c = sqlite3VdbeRecordCompareParsed(nCellKey, pCellKey, pPKey);
        }else{
          pCellKey = sqlite3_malloc( nCellKey );
          if( pCellKey==0 ) return SQLITE_NOMEM;



          rc = sqlite3BtreeKey(pCur, 0, nCellKey, (void *)pCellKey);
          c = sqlite3VdbeRecordCompareParsed(nCellKey, pCellKey, pPKey);
          sqlite3_free(pCellKey);
          if( rc ) goto moveto_finish;
        }
      }
      if( c==0 ){







|







 







|
>
>
>







5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
....
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.445 2008/03/25 09:56:45 danielk1977 Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
** Including a description of file format and an overview of operation.
*/
#include "btreeInt.h"

................................................................................
        int available;
        pCellKey = (void *)fetchPayload(pCur, &available, 0);
        nCellKey = pCur->info.nKey;
        if( available>=nCellKey ){
          c = sqlite3VdbeRecordCompareParsed(nCellKey, pCellKey, pPKey);
        }else{
          pCellKey = sqlite3_malloc( nCellKey );
          if( pCellKey==0 ){
            rc = SQLITE_NOMEM;
            goto moveto_finish;
          }
          rc = sqlite3BtreeKey(pCur, 0, nCellKey, (void *)pCellKey);
          c = sqlite3VdbeRecordCompareParsed(nCellKey, pCellKey, pPKey);
          sqlite3_free(pCellKey);
          if( rc ) goto moveto_finish;
        }
      }
      if( c==0 ){