Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | The power-of-two first-fit memory allocator is now working. (CVS 4793) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
d134d29cea971eb01a0e0fd94341ab79 |
User & Date: | drh 2008-02-16 16:21:46.000 |
Context
2008-02-18
| ||
14:47 | Add the Bitvec object for tracking which pages have been journalled. This reduces memory consumption and runs faster than the bitmap approach it replaced. (CVS 4794) (check-in: 7c57bdbcdb user: drh tags: trunk) | |
2008-02-16
| ||
16:21 | The power-of-two first-fit memory allocator is now working. (CVS 4793) (check-in: d134d29cea user: drh tags: trunk) | |
2008-02-15
| ||
17:38 | Fix a bug in the ".show" command of the CLI. Ticket #2942. (CVS 4792) (check-in: dedf5f230b user: drh tags: trunk) | |
Changes
Changes to src/mem5.c.
︙ | ︙ | |||
16 17 18 19 20 21 22 | ** use of malloc(). All dynamically allocatable memory is ** contained in a static array, mem.aPool[]. The size of this ** fixed memory pool is SQLITE_POW2_MEMORY_SIZE bytes. ** ** This version of the memory allocation subsystem is used if ** and only if SQLITE_POW2_MEMORY_SIZE is defined. ** | | | > > > | | > < > > | | < < < < < | < < < < < < | < > | < | > | < < < < < > | < < | < < < | | | | < < < | | > > > > > > > > > > > > > > > > | | > > > > > | > > | < < < < > < < | < < < < | < | < < > | | | > > > > > > | | < | | | < < | | | | < | < | | < < < < < | < < < < < < < < | | | < < < < < < < < < < < < | < | < < < < < < < > | > > > > < < | | > | | | > | > < < < < | | | | < < | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | ** use of malloc(). All dynamically allocatable memory is ** contained in a static array, mem.aPool[]. The size of this ** fixed memory pool is SQLITE_POW2_MEMORY_SIZE bytes. ** ** This version of the memory allocation subsystem is used if ** and only if SQLITE_POW2_MEMORY_SIZE is defined. ** ** $Id: mem5.c,v 1.2 2008/02/16 16:21:46 drh Exp $ */ #include "sqliteInt.h" /* ** This version of the memory allocator is used only when ** SQLITE_POW2_MEMORY_SIZE is defined. */ #ifdef SQLITE_POW2_MEMORY_SIZE /* ** Log2 of the minimum size of an allocation. For example, if ** 4 then all allocations will be rounded up to at least 16 bytes. ** If 5 then all allocations will be rounded up to at least 32 bytes. */ #ifndef SQLITE_POW2_LOGMIN # define SQLITE_POW2_LOGMIN 6 #endif #define POW2_MIN (1<<SQLITE_POW2_LOGMIN) /* ** Log2 of the maximum size of an allocation. */ #ifndef SQLITE_POW2_LOGMAX # define SQLITE_POW2_LOGMAX 18 #endif #define POW2_MAX (((unsigned int)1)<<SQLITE_POW2_LOGMAX) /* ** Number of distinct allocation sizes. */ #define NSIZE (SQLITE_POW2_LOGMAX - SQLITE_POW2_LOGMIN + 1) /* ** A minimum allocation is an instance of the following structure. ** Larger allocations are an array of these structures where the ** size of the array is a power of 2. */ typedef struct Mem5Block Mem5Block; struct Mem5Block { union { char aData[POW2_MIN]; struct { int next; /* Index in mem.aPool[] of next free chunk */ int prev; /* Index in mem.aPool[] of previous free chunk */ } list; } u; }; /* ** Number of blocks of memory available for allocation. */ #define NBLOCK (SQLITE_POW2_MEMORY_SIZE/POW2_MIN) /* ** The size in blocks of an POW2_MAX allocation */ #define SZ_MAX (1<<(NSIZE-1)) /* ** Masks used for mem.aCtrl[] elements. */ #define CTRL_LOGSIZE 0x1f /* Log2 Size of this block relative to POW2_MIN */ #define CTRL_FREE 0x20 /* True if not checked out */ /* ** All of the static variables used by this module are collected ** into a single structure named "mem". This is to keep the ** static variables organized and to reduce namespace pollution ** when this module is combined with other in the amalgamation. */ static struct { /* ** True if we are evaluating an out-of-memory callback. */ int alarmBusy; /* ** Mutex to control access to the memory allocation subsystem. */ sqlite3_mutex *mutex; /* ** Performance statistics */ u64 nAlloc; /* Total number of calls to malloc */ u64 totalAlloc; /* Total of all malloc calls - includes internal frag */ u64 totalExcess; /* Total internal fragmentation */ u32 currentOut; /* Current checkout, including internal fragmentation */ u32 currentCount; /* Current number of distinct checkouts */ u32 maxOut; /* Maximum instantaneous currentOut */ u32 maxCount; /* Maximum instantaneous currentCount */ u32 maxRequest; /* Largest allocation (exclusive of internal frag) */ /* ** Lists of free blocks of various sizes. */ int aiFreelist[NSIZE]; /* ** Space for tracking which blocks are checked out and the size ** of each block. One byte per block. */ u8 aCtrl[NBLOCK]; /* ** Memory available for allocation */ Mem5Block aPool[NBLOCK]; } mem; /* ** Unlink the chunk at mem.aPool[i] from list it is currently ** on. It should be found on mem.aiFreelist[iLogsize]. */ static void memsys5Unlink(int i, int iLogsize){ int next, prev; assert( i>=0 && i<NBLOCK ); assert( iLogsize>=0 && iLogsize<NSIZE ); assert( (mem.aCtrl[i] & CTRL_LOGSIZE)==iLogsize ); assert( sqlite3_mutex_held(mem.mutex) ); next = mem.aPool[i].u.list.next; prev = mem.aPool[i].u.list.prev; if( prev<0 ){ mem.aiFreelist[iLogsize] = next; }else{ mem.aPool[prev].u.list.next = next; } if( next>=0 ){ mem.aPool[next].u.list.prev = prev; } } /* ** Link the chunk at mem.aPool[i] so that is on the iLogsize ** free list. */ static void memsys5Link(int i, int iLogsize){ int x; assert( sqlite3_mutex_held(mem.mutex) ); assert( i>=0 && i<NBLOCK ); assert( iLogsize>=0 && iLogsize<NSIZE ); assert( (mem.aCtrl[i] & CTRL_LOGSIZE)==iLogsize ); mem.aPool[i].u.list.next = x = mem.aiFreelist[iLogsize]; mem.aPool[i].u.list.prev = -1; if( x>=0 ){ assert( x<NBLOCK ); mem.aPool[x].u.list.prev = i; } mem.aiFreelist[iLogsize] = i; } /* ** Enter the mutex mem.mutex. Allocate it if it is not already allocated. ** ** Also: Initialize the memory allocation subsystem the first time ** this routine is called. */ static void memsys5Enter(void){ if( mem.mutex==0 ){ int i; assert( sizeof(Mem5Block)==POW2_MIN ); assert( (SQLITE_POW2_MEMORY_SIZE % POW2_MAX)==0 ); assert( SQLITE_POW2_MEMORY_SIZE>=POW2_MAX ); mem.mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MEM); sqlite3_mutex_enter(mem.mutex); for(i=0; i<NSIZE; i++) mem.aiFreelist[i] = -1; for(i=0; i<=NBLOCK-SZ_MAX; i += SZ_MAX){ mem.aCtrl[i] = (NSIZE-1) | CTRL_FREE; memsys5Link(i, NSIZE-1); } }else{ sqlite3_mutex_enter(mem.mutex); } } /* ** Return the amount of memory currently checked out. */ sqlite3_int64 sqlite3_memory_used(void){ return mem.currentOut; } /* ** Return the maximum amount of memory that has ever been ** checked out since either the beginning of this process ** or since the most recent reset. */ sqlite3_int64 sqlite3_memory_highwater(int resetFlag){ sqlite3_int64 n; memsys5Enter(); n = mem.maxOut; if( resetFlag ){ mem.maxOut = mem.currentOut; } sqlite3_mutex_leave(mem.mutex); return n; } /* ** Change the alarm callback. ** |
︙ | ︙ | |||
274 275 276 277 278 279 280 | ){ return SQLITE_OK; } /* ** Called when we are unable to satisfy an allocation of nBytes. */ | | | | | | | < | < < | < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < | < < < < < < < < < < < < < < < < < < | | | > | < < < < < < < < | | < < < < < | < < < < < < < < | | | | | < < < < | | | < < < < < < < | | < | > > | < > | < | < | | < < | < < < < < < | | | < < < < < < < < < | < | | < < < < < < < | < | < | < < < < | | | | > | < | | > | | | | > | > > > < | | > | | | < > | < < > | > | > | | > > | | > > | | | | | < | < < < | | | | < | | < | < < | < | < < < < < < < < < < < < < < < < < | < | < < | < < < | < | < < | < | < < | 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 | ){ return SQLITE_OK; } /* ** Called when we are unable to satisfy an allocation of nBytes. */ static void memsys5OutOfMemory(int nByte){ if( !mem.alarmBusy ){ mem.alarmBusy = 1; assert( sqlite3_mutex_held(mem.mutex) ); sqlite3_mutex_leave(mem.mutex); sqlite3_release_memory(nByte); sqlite3_mutex_enter(mem.mutex); mem.alarmBusy = 0; } } /* ** Return the size of an outstanding allocation, in bytes. The ** size returned omits the 8-byte header overhead. This only ** works for chunks that are currently checked out. */ int sqlite3MallocSize(void *p){ int iSize = 0; if( p ){ int i = ((Mem5Block*)p) - mem.aPool; assert( i>=0 && i<NBLOCK ); iSize = 1 << ((mem.aCtrl[i]&CTRL_LOGSIZE) + SQLITE_POW2_LOGMIN); } return iSize; } /* ** Find the first entry on the freelist iLogsize. Unlink that ** entry and return its index. */ static int memsys5UnlinkFirst(int iLogsize){ int i; int iFirst; assert( iLogsize>=0 && iLogsize<NSIZE ); i = iFirst = mem.aiFreelist[iLogsize]; assert( iFirst>=0 ); while( i>0 ){ if( i<iFirst ) iFirst = i; i = mem.aPool[i].u.list.next; } memsys5Unlink(iFirst, iLogsize); return iFirst; } /* ** Return a block of memory of at least nBytes in size. ** Return NULL if unable. */ static void *memsys5Malloc(int nByte){ int i; /* Index of a mem.aPool[] slot */ int iBin; /* Index into mem.aiFreelist[] */ int iFullSz; /* Size of allocation rounded up to power of 2 */ int iLogsize; /* Log2 of iFullSz/POW2_MIN */ assert( sqlite3_mutex_held(mem.mutex) ); if( nByte>mem.maxRequest ) mem.maxRequest = nByte; if( nByte>POW2_MAX ) return 0; for(iFullSz=POW2_MIN, iLogsize=0; iFullSz<nByte; iFullSz *= 2, iLogsize++){} for(iBin=iLogsize; mem.aiFreelist[iBin]<0 && iBin<NSIZE; iBin++){} if( iBin>=NSIZE ) return 0; i = memsys5UnlinkFirst(iBin); while( iBin>iLogsize ){ int newSize; iBin--; newSize = 1 << iBin; mem.aCtrl[i+newSize] = CTRL_FREE | iBin; memsys5Link(i+newSize, iBin); } mem.aCtrl[i] = iLogsize; mem.nAlloc++; mem.totalAlloc += iFullSz; mem.totalExcess += iFullSz - nByte; mem.currentCount++; mem.currentOut += iFullSz; if( mem.maxCount<mem.currentCount ) mem.maxCount = mem.currentCount; if( mem.maxOut<mem.currentOut ) mem.maxOut = mem.currentOut; return (void*)&mem.aPool[i]; } /* ** Free an outstanding memory allocation. */ void memsys5Free(void *pOld){ u32 size, iLogsize; int i; i = ((Mem5Block*)pOld) - mem.aPool; assert( sqlite3_mutex_held(mem.mutex) ); assert( i>=0 && i<NBLOCK ); assert( (mem.aCtrl[i] & CTRL_FREE)==0 ); iLogsize = mem.aCtrl[i] & CTRL_LOGSIZE; size = 1<<iLogsize; assert( i+size-1<NBLOCK ); mem.aCtrl[i] |= CTRL_FREE; mem.aCtrl[i+size-1] |= CTRL_FREE; assert( mem.currentCount>0 ); assert( mem.currentOut>=0 ); mem.currentCount--; mem.currentOut -= size*POW2_MIN; assert( mem.currentOut>0 || mem.currentCount==0 ); assert( mem.currentCount>0 || mem.currentOut==0 ); mem.aCtrl[i] = CTRL_FREE | iLogsize; while( iLogsize<NSIZE-1 ){ int iBuddy; if( (i>>iLogsize) & 1 ){ iBuddy = i - size; }else{ iBuddy = i + size; } assert( iBuddy>=0 && iBuddy<NBLOCK ); if( mem.aCtrl[iBuddy]!=(CTRL_FREE | iLogsize) ) break; memsys5Unlink(iBuddy, iLogsize); iLogsize++; if( iBuddy<i ){ mem.aCtrl[iBuddy] = CTRL_FREE | iLogsize; mem.aCtrl[i] = 0; i = iBuddy; }else{ mem.aCtrl[i] = CTRL_FREE | iLogsize; mem.aCtrl[iBuddy] = 0; } size *= 2; } memsys5Link(i, iLogsize); } /* ** Allocate nBytes of memory */ void *sqlite3_malloc(int nBytes){ sqlite3_int64 *p = 0; if( nBytes>0 ){ memsys5Enter(); p = memsys5Malloc(nBytes); sqlite3_mutex_leave(mem.mutex); } return (void*)p; } /* ** Free memory. */ void sqlite3_free(void *pPrior){ if( pPrior==0 ){ return; } assert( mem.mutex!=0 ); sqlite3_mutex_enter(mem.mutex); memsys5Free(pPrior); sqlite3_mutex_leave(mem.mutex); } /* ** Change the size of an existing memory allocation */ void *sqlite3_realloc(void *pPrior, int nBytes){ int nOld; void *p; if( pPrior==0 ){ return sqlite3_malloc(nBytes); } if( nBytes<=0 ){ sqlite3_free(pPrior); return 0; } assert( mem.mutex!=0 ); nOld = sqlite3MallocSize(pPrior); if( nBytes<=nOld ){ return pPrior; } sqlite3_mutex_enter(mem.mutex); p = memsys5Malloc(nBytes); if( p ){ memcpy(p, pPrior, nOld); memsys5Free(pPrior); } sqlite3_mutex_leave(mem.mutex); return p; } /* ** Open the file indicated and write a log of all unfreed memory ** allocations into that log. */ void sqlite3_memdebug_dump(const char *zFilename){ #ifdef SQLITE_DEBUG FILE *out; int i, j, n; if( zFilename==0 || zFilename[0]==0 ){ out = stdout; }else{ out = fopen(zFilename, "w"); if( out==0 ){ fprintf(stderr, "** Unable to output memory debug output log: %s **\n", zFilename); return; } } memsys5Enter(); for(i=0; i<NSIZE; i++){ for(n=0, j=mem.aiFreelist[i]; j>=0; j = mem.aPool[j].u.list.next, n++){} fprintf(out, "freelist items of size %d: %d\n", POW2_MIN << i, n); } fprintf(out, "mem.nAlloc = %llu\n", mem.nAlloc); fprintf(out, "mem.totalAlloc = %llu\n", mem.totalAlloc); fprintf(out, "mem.totalExcess = %llu\n", mem.totalExcess); fprintf(out, "mem.currentOut = %u\n", mem.currentOut); fprintf(out, "mem.currentCount = %u\n", mem.currentCount); fprintf(out, "mem.maxOut = %u\n", mem.maxOut); fprintf(out, "mem.maxCount = %u\n", mem.maxCount); fprintf(out, "mem.maxRequest = %u\n", mem.maxRequest); sqlite3_mutex_leave(mem.mutex); if( out==stdout ){ fflush(stdout); }else{ fclose(out); } #endif } #endif /* !SQLITE_POW2_MEMORY_SIZE */ |
Changes to src/test_config.c.
︙ | ︙ | |||
12 13 14 15 16 17 18 | ** ** This file contains code used for testing the SQLite system. ** None of the code in this file goes into a deliverable build. ** ** The focus of this file is providing the TCL testing layer ** access to compile-time constants. ** | | | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ** ** This file contains code used for testing the SQLite system. ** None of the code in this file goes into a deliverable build. ** ** The focus of this file is providing the TCL testing layer ** access to compile-time constants. ** ** $Id: test_config.c,v 1.20 2008/02/16 16:21:46 drh Exp $ */ #include "sqliteLimit.h" int sqlite3MAX_LENGTH = SQLITE_MAX_LENGTH; int sqlite3MAX_COLUMN = SQLITE_MAX_COLUMN; int sqlite3MAX_SQL_LENGTH = SQLITE_MAX_SQL_LENGTH; |
︙ | ︙ | |||
83 84 85 86 87 88 89 90 91 92 93 94 95 96 | #endif #ifdef SQLITE_MEMORY_SIZE Tcl_SetVar2(interp, "sqlite_options", "mem3", "1", TCL_GLOBAL_ONLY); #else Tcl_SetVar2(interp, "sqlite_options", "mem3", "0", TCL_GLOBAL_ONLY); #endif #ifdef SQLITE_OMIT_ALTERTABLE Tcl_SetVar2(interp, "sqlite_options", "altertable", "0", TCL_GLOBAL_ONLY); #else Tcl_SetVar2(interp, "sqlite_options", "altertable", "1", TCL_GLOBAL_ONLY); #endif | > > > > > > | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | #endif #ifdef SQLITE_MEMORY_SIZE Tcl_SetVar2(interp, "sqlite_options", "mem3", "1", TCL_GLOBAL_ONLY); #else Tcl_SetVar2(interp, "sqlite_options", "mem3", "0", TCL_GLOBAL_ONLY); #endif #ifdef SQLITE_POW2_MEMORY_SIZE Tcl_SetVar2(interp, "sqlite_options", "mem5", "1", TCL_GLOBAL_ONLY); #else Tcl_SetVar2(interp, "sqlite_options", "mem5", "0", TCL_GLOBAL_ONLY); #endif #ifdef SQLITE_OMIT_ALTERTABLE Tcl_SetVar2(interp, "sqlite_options", "altertable", "0", TCL_GLOBAL_ONLY); #else Tcl_SetVar2(interp, "sqlite_options", "altertable", "1", TCL_GLOBAL_ONLY); #endif |
︙ | ︙ |
Changes to src/test_malloc.c.
︙ | ︙ | |||
9 10 11 12 13 14 15 | ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** This file contains code used to implement test interfaces to the ** memory allocation subsystem. ** | | | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** This file contains code used to implement test interfaces to the ** memory allocation subsystem. ** ** $Id: test_malloc.c,v 1.13 2008/02/16 16:21:46 drh Exp $ */ #include "sqliteInt.h" #include "tcl.h" #include <stdlib.h> #include <string.h> #include <assert.h> |
︙ | ︙ | |||
330 331 332 333 334 335 336 | int objc, Tcl_Obj *CONST objv[] ){ if( objc!=2 ){ Tcl_WrongNumArgs(interp, 1, objv, "FILENAME"); return TCL_ERROR; } | | > | 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | int objc, Tcl_Obj *CONST objv[] ){ if( objc!=2 ){ Tcl_WrongNumArgs(interp, 1, objv, "FILENAME"); return TCL_ERROR; } #if defined(SQLITE_MEMDEBUG) || defined(SQLITE_MEMORY_SIZE) \ || defined(SQLITE_POW2_MEMORY_SIZE) { extern void sqlite3_memdebug_dump(const char*); sqlite3_memdebug_dump(Tcl_GetString(objv[1])); } #endif return TCL_OK; } |
︙ | ︙ |
Changes to test/tester.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # 2001 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 implements some common TCL routines used for regression # testing the SQLite library # | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 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 implements some common TCL routines used for regression # testing the SQLite library # # $Id: tester.tcl,v 1.105 2008/02/16 16:21:46 drh Exp $ set tcl_precision 15 set sqlite_pending_byte 0x0010000 # # Check the command-line arguments for a default soft-heap-limit. |
︙ | ︙ | |||
211 212 213 214 215 216 217 | if {$sqlite_open_file_count} { puts "$sqlite_open_file_count files were left open" incr nErr } if {[sqlite3_memory_used]>0} { puts "Unfreed memory: [sqlite3_memory_used] bytes" incr nErr | | | | 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | if {$sqlite_open_file_count} { puts "$sqlite_open_file_count files were left open" incr nErr } if {[sqlite3_memory_used]>0} { puts "Unfreed memory: [sqlite3_memory_used] bytes" incr nErr ifcapable memdebug||mem5||(mem3&&debug) { puts "Writing unfreed memory log to \"./memleak.txt\"" sqlite3_memdebug_dump ./memleak.txt } } else { puts "All memory allocations freed - no leaks" ifcapable memdebug||mem5 { sqlite3_memdebug_dump ./memusage.txt } } puts "Maximum memory usage: [sqlite3_memory_highwater 1] bytes" puts "Current memory usage: [sqlite3_memory_highwater] bytes" if {[info commands sqlite3_memdebug_malloc_count] ne ""} { puts "Number of malloc() : [sqlite3_memdebug_malloc_count] calls" |
︙ | ︙ |
Changes to tool/mksqlite3c.tcl.
︙ | ︙ | |||
204 205 206 207 208 209 210 211 212 213 214 215 216 217 | date.c os.c fault.c mem1.c mem2.c mem3.c mutex.c mutex_os2.c mutex_unix.c mutex_w32.c malloc.c printf.c random.c | > | 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | date.c os.c fault.c mem1.c mem2.c mem3.c mem5.c mutex.c mutex_os2.c mutex_unix.c mutex_w32.c malloc.c printf.c random.c |
︙ | ︙ |