SQLite

Check-in [96453ca16e]
Login

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

Overview
Comment:Minor changes to get memsys5 compiling and its tests passing. Ticket #3495. (CVS 5901)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 96453ca16e90bc0c0cbfb75b3e39899f56d6ea66
User & Date: danielk1977 2008-11-13 16:21:50.000
Context
2008-11-13
18:00
Avoid committing a transaction from within the xSync() method of a virtual table. Fix for #3497. (CVS 5902) (check-in: eabb8b7591 user: danielk1977 tags: trunk)
16:21
Minor changes to get memsys5 compiling and its tests passing. Ticket #3495. (CVS 5901) (check-in: 96453ca16e user: danielk1977 tags: trunk)
14:42
Update mksqlite3c.tcl to include new file pcache1.c. (CVS 5900) (check-in: 00442e0f57 user: danielk1977 tags: trunk)
Changes
Unified Diff Show Whitespace Changes Patch
Changes to src/mem5.c.
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
** implementations. Once sqlite3_initialize() has been called,
** the amount of memory available to SQLite is fixed and cannot
** be changed.
**
** This version of the memory allocation subsystem is included
** in the build only if SQLITE_ENABLE_MEMSYS5 is defined.
**
** $Id: mem5.c,v 1.15 2008/10/28 18:58:20 drh Exp $
*/
#include "sqliteInt.h"

/*
** This version of the memory allocator is used only when 
** SQLITE_ENABLE_MEMSYS5 is defined.
*/







|







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
** implementations. Once sqlite3_initialize() has been called,
** the amount of memory available to SQLite is fixed and cannot
** be changed.
**
** This version of the memory allocation subsystem is included
** in the build only if SQLITE_ENABLE_MEMSYS5 is defined.
**
** $Id: mem5.c,v 1.16 2008/11/13 16:21:50 danielk1977 Exp $
*/
#include "sqliteInt.h"

/*
** This version of the memory allocator is used only when 
** SQLITE_ENABLE_MEMSYS5 is defined.
*/
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
  /* Keep track of the maximum allocation request.  Even unfulfilled
  ** requests are counted */
  if( nByte>mem5.maxRequest ){
    mem5.maxRequest = nByte;
  }

  /* Round nByte up to the next valid power of two */
  if( nByte>POW2_MAX ) return 0;
  for(iFullSz=mem5.nAtom, iLogsize=0; iFullSz<nByte; iFullSz *= 2, iLogsize++){}

  /* Make sure mem5.aiFreelist[iLogsize] contains at least one free
  ** block.  If not, then split a block of the next larger power of
  ** two in order to create a new free block of size iLogsize.
  */
  for(iBin=iLogsize; mem5.aiFreelist[iBin]<0 && iBin<=LOGMAX; iBin++){}







<







209
210
211
212
213
214
215

216
217
218
219
220
221
222
  /* Keep track of the maximum allocation request.  Even unfulfilled
  ** requests are counted */
  if( nByte>mem5.maxRequest ){
    mem5.maxRequest = nByte;
  }

  /* Round nByte up to the next valid power of two */

  for(iFullSz=mem5.nAtom, iLogsize=0; iFullSz<nByte; iFullSz *= 2, iLogsize++){}

  /* Make sure mem5.aiFreelist[iLogsize] contains at least one free
  ** block.  If not, then split a block of the next larger power of
  ** two in order to create a new free block of size iLogsize.
  */
  for(iBin=iLogsize; mem5.aiFreelist[iBin]<0 && iBin<=LOGMAX; iBin++){}
Changes to test/pcache2.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

25
26
27

28
29
30
31
32
33
34
# 2008 September 15
#
# The author disclaims copyright to this source code.  In place of
# 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.
#
#***********************************************************************
#
# This file is focused on testing the pcache module.
#
# $Id: pcache2.test,v 1.2 2008/10/14 19:21:52 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl


# Set up a pcache memory pool so that we can easily track how many
# pages are being used for cache.
#
do_test pcache2-1.1 {
  db close

  sqlite3_shutdown
  sqlite3_config_pagecache 6000 100
  sqlite3_initialize

  sqlite3_status SQLITE_STATUS_PAGECACHE_USED 1
  sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0
} {0 0 0}

# Open up two database connections to separate files.
#
do_test pcache2-1.2 {













|










>



>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# 2008 September 15
#
# The author disclaims copyright to this source code.  In place of
# 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.
#
#***********************************************************************
#
# This file is focused on testing the pcache module.
#
# $Id: pcache2.test,v 1.3 2008/11/13 16:21:50 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl


# Set up a pcache memory pool so that we can easily track how many
# pages are being used for cache.
#
do_test pcache2-1.1 {
  db close
  sqlite3_reset_auto_extension
  sqlite3_shutdown
  sqlite3_config_pagecache 6000 100
  sqlite3_initialize
  autoinstall_test_functions
  sqlite3_status SQLITE_STATUS_PAGECACHE_USED 1
  sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0
} {0 0 0}

# Open up two database connections to separate files.
#
do_test pcache2-1.2 {
64
65
66
67
68
69
70

71
72



73
     INSERT INTO t1 SELECT x+1000, y FROM t2;
  }
  sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0
} {0 13 13}

db close
catch {db2 close}

sqlite3_shutdown
sqlite3_config_pagecache 0 0



finish_test







>


>
>
>

66
67
68
69
70
71
72
73
74
75
76
77
78
79
     INSERT INTO t1 SELECT x+1000, y FROM t2;
  }
  sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0
} {0 13 13}

db close
catch {db2 close}
sqlite3_reset_auto_extension
sqlite3_shutdown
sqlite3_config_pagecache 0 0
sqlite3_initialize
autoinstall_test_functions

finish_test
Changes to test/permutations.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 2008 June 21
#
# The author disclaims copyright to this source code.  In place of
# 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: permutations.test,v 1.37 2008/11/10 18:05:36 shane Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Argument processing.
#
#puts "PERM-DEBUG: argv=$argv"











|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 2008 June 21
#
# The author disclaims copyright to this source code.  In place of
# 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: permutations.test,v 1.38 2008/11/13 16:21:50 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Argument processing.
#
#puts "PERM-DEBUG: argv=$argv"
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
    Run tests using the allocator in mem5.c.
  } -exclude {
    autovacuum.test           delete3.test              manydb.test
    bigrow.test               incrblob2.test            memdb.test
    bitvec.test               index2.test               memsubsys1.test
    capi3c.test               ioerr.test                memsubsys2.test
    capi3.test                join3.test                pagesize.test
    collate5.test             limit.test
  } -initialize {
    catch {db close}
    sqlite3_reset_auto_extension
    sqlite3_shutdown
    sqlite3_config_heap 25000000 64
    sqlite3_config_lookaside 0 0
    install_malloc_faultsim 1 







|







501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
    Run tests using the allocator in mem5.c.
  } -exclude {
    autovacuum.test           delete3.test              manydb.test
    bigrow.test               incrblob2.test            memdb.test
    bitvec.test               index2.test               memsubsys1.test
    capi3c.test               ioerr.test                memsubsys2.test
    capi3.test                join3.test                pagesize.test
    collate5.test             limit.test                zeroblob.test
  } -initialize {
    catch {db close}
    sqlite3_reset_auto_extension
    sqlite3_shutdown
    sqlite3_config_heap 25000000 64
    sqlite3_config_lookaside 0 0
    install_malloc_faultsim 1