Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Use the default sqlite4_mm object for malloc() and free(). |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
e3280f458535891a72bd5f5fa4ef170b |
User & Date: | dan 2013-05-18 19:42:42.907 |
Context
2013-05-21
| ||
18:19 | Re-enable memory statistics and backtraces. check-in: 75b8ccc0a8 user: dan tags: trunk | |
2013-05-18
| ||
19:42 | Use the default sqlite4_mm object for malloc() and free(). check-in: e3280f4585 user: dan tags: trunk | |
2013-05-10
| ||
19:19 | Change sqlite4_prepare() to return the number of bytes read from the input SQL script via an output variable (instead of returning a pointer to the next SQL statement within the buffer). check-in: 79197d57b4 user: dan tags: trunk | |
Changes
Changes to src/env.c.
︙ | ︙ | |||
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | SQLITE4_DEFAULT_MEMSTATUS, /* bMemstat */ 1, /* bCoreMutex */ SQLITE4_THREADSAFE==1, /* bFullMutex */ 0x7ffffffe, /* mxStrlen */ 128, /* szLookaside */ 500, /* nLookaside */ &sqlite4MMSystem, /* pMM */ {0,0,0,0,0,0,0,0,0}, /* m */ {0,0,0,0,0,0,0,0,0,0}, /* mutex */ (void*)0, /* pHeap */ 0, /* nHeap */ 0, 0, /* mnHeap, mxHeap */ 0, /* mxParserStack */ &sqlite4BuiltinFactory, /* pFactory */ sqlite4OsRandomness, /* xRandomness */ | > > | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | SQLITE4_DEFAULT_MEMSTATUS, /* bMemstat */ 1, /* bCoreMutex */ SQLITE4_THREADSAFE==1, /* bFullMutex */ 0x7ffffffe, /* mxStrlen */ 128, /* szLookaside */ 500, /* nLookaside */ &sqlite4MMSystem, /* pMM */ #if 0 {0,0,0,0,0,0,0,0,0}, /* m */ #endif {0,0,0,0,0,0,0,0,0,0}, /* mutex */ (void*)0, /* pHeap */ 0, /* nHeap */ 0, 0, /* mnHeap, mxHeap */ 0, /* mxParserStack */ &sqlite4BuiltinFactory, /* pFactory */ sqlite4OsRandomness, /* xRandomness */ |
︙ | ︙ | |||
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 | /* ** sqlite4_env_config(p, SQLITE4_ENVCONFIG_MALLOC, sqlite4_mem_methods*) ** ** Set the memory allocation routines to be used by this environment. */ case SQLITE4_ENVCONFIG_MALLOC: { /* Specify an alternative malloc implementation */ if( pEnv->isInit ) return SQLITE4_MISUSE; pEnv->m = *va_arg(ap, sqlite4_mem_methods*); break; } /* ** sqlite4_env_config(p, SQLITE4_ENVCONFIG_GETMALLOC, sqlite4_mem_methods*) ** ** Copy the memory allocation routines in use by this environment ** into the structure given in the argument. */ case SQLITE4_ENVCONFIG_GETMALLOC: { /* Retrieve the current malloc() implementation */ if( pEnv->m.xMalloc==0 ) sqlite4MemSetDefault(pEnv); *va_arg(ap, sqlite4_mem_methods*) = pEnv->m; break; } /* sqlite4_env_config(p, SQLITE4_ENVCONFIG_MEMSTAT, int onoff); ** ** Enable or disable collection of memory usage statistics according to ** the onoff parameter. | > > > > | 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 | /* ** sqlite4_env_config(p, SQLITE4_ENVCONFIG_MALLOC, sqlite4_mem_methods*) ** ** Set the memory allocation routines to be used by this environment. */ case SQLITE4_ENVCONFIG_MALLOC: { #if 0 /* Specify an alternative malloc implementation */ if( pEnv->isInit ) return SQLITE4_MISUSE; pEnv->m = *va_arg(ap, sqlite4_mem_methods*); #endif break; } /* ** sqlite4_env_config(p, SQLITE4_ENVCONFIG_GETMALLOC, sqlite4_mem_methods*) ** ** Copy the memory allocation routines in use by this environment ** into the structure given in the argument. */ case SQLITE4_ENVCONFIG_GETMALLOC: { #if 0 /* Retrieve the current malloc() implementation */ if( pEnv->m.xMalloc==0 ) sqlite4MemSetDefault(pEnv); *va_arg(ap, sqlite4_mem_methods*) = pEnv->m; #endif break; } /* sqlite4_env_config(p, SQLITE4_ENVCONFIG_MEMSTAT, int onoff); ** ** Enable or disable collection of memory usage statistics according to ** the onoff parameter. |
︙ | ︙ |
Changes to src/fault.c.
︙ | ︙ | |||
29 30 31 32 33 34 35 | #ifndef SQLITE4_OMIT_BUILTIN_TEST /* ** This (sqlite4EndBenignMalloc()) is called by SQLite code to indicate that ** subsequent malloc failures are benign. A call to sqlite4EndBenignMalloc() ** indicates that subsequent malloc failures are non-benign. */ void sqlite4BeginBenignMalloc(sqlite4_env *pEnv){ | | | | 29 30 31 32 33 34 35 36 37 38 39 40 41 | #ifndef SQLITE4_OMIT_BUILTIN_TEST /* ** This (sqlite4EndBenignMalloc()) is called by SQLite code to indicate that ** subsequent malloc failures are benign. A call to sqlite4EndBenignMalloc() ** indicates that subsequent malloc failures are non-benign. */ void sqlite4BeginBenignMalloc(sqlite4_env *pEnv){ sqlite4_mm_benign_failures(pEnv->pMM, 1); } void sqlite4EndBenignMalloc(sqlite4_env *pEnv){ sqlite4_mm_benign_failures(pEnv->pMM, 0); } #endif /* #ifndef SQLITE4_OMIT_BUILTIN_TEST */ |
Changes to src/malloc.c.
︙ | ︙ | |||
15 16 17 18 19 20 21 | #include "sqliteInt.h" #include <stdarg.h> /* ** Initialize the memory allocation subsystem. */ int sqlite4MallocInit(sqlite4_env *pEnv){ | < | < | < < < < | < < < < < < < < < | < < < < < < < < < < | | < < | < < < < | < < < < | < | 15 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 | #include "sqliteInt.h" #include <stdarg.h> /* ** Initialize the memory allocation subsystem. */ int sqlite4MallocInit(sqlite4_env *pEnv){ /* TODO: SQLite3 has sqlite3_mem_methods.xInit. But src4 does not? */ return SQLITE4_OK; } /* ** Deinitialize the memory allocation subsystem. */ void sqlite4MallocEnd(sqlite4_env *pEnv){ /* TODO: Should sqlite4_mm_methods.xFinal() be called here? Or some ** reference count decremented? */ } /* ** Allocate memory. This routine is like sqlite4_malloc() except that it ** assumes the memory subsystem has already been initialized. */ void *sqlite4Malloc(sqlite4_env *pEnv, int n){ void *p; /* Return value */ if( pEnv==0 ) pEnv = &sqlite4DefaultEnv; if( n<=0 /* IMP: R-65312-04917 */ || n>=0x7fffff00 ){ /* A memory allocation of a number of bytes which is near the maximum ** signed integer value might cause an integer overflow inside of the ** xMalloc(). Hence we limit the maximum size to 0x7fffff00, giving ** 255 bytes of overhead. SQLite itself will never use anything near ** this amount. The only way to reach the limit is with sqlite4_malloc() */ p = 0; }else{ p = sqlite4_mm_malloc(pEnv->pMM, n); } assert( EIGHT_BYTE_ALIGNMENT(p) ); /* IMP: R-04675-44850 */ return p; } /* ** This version of the memory allocation is for use by the application. ** First make sure the memory subsystem is initialized, then do the ** allocation. */ void *sqlite4_malloc(sqlite4_env *pEnv, sqlite4_size_t n){ #ifndef SQLITE4_OMIT_AUTOINIT if( sqlite4_initialize(pEnv) ) return 0; #endif return sqlite4Malloc(pEnv, (int)n); } /* ** TRUE if p is a lookaside memory allocation from db */ |
︙ | ︙ | |||
119 120 121 122 123 124 125 126 | /* ** Return the size of a memory allocation previously obtained from ** sqlite4Malloc() or sqlite4_malloc(). */ int sqlite4MallocSize(sqlite4_env *pEnv, void *p){ assert( sqlite4MemdebugHasType(p, MEMTYPE_HEAP) ); assert( sqlite4MemdebugNoType(p, MEMTYPE_DB) ); if( pEnv==0 ) pEnv = &sqlite4DefaultEnv; | > | | < < < < > < < < < < | < < < < | 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 | /* ** Return the size of a memory allocation previously obtained from ** sqlite4Malloc() or sqlite4_malloc(). */ int sqlite4MallocSize(sqlite4_env *pEnv, void *p){ assert( sqlite4MemdebugHasType(p, MEMTYPE_HEAP) ); assert( sqlite4MemdebugNoType(p, MEMTYPE_DB) ); if( pEnv==0 ) pEnv = &sqlite4DefaultEnv; return sqlite4_mm_msize(pEnv->pMM, p); } int sqlite4DbMallocSize(sqlite4 *db, void *p){ assert( db==0 || sqlite4_mutex_held(db->mutex) ); if( db && isLookaside(db, p) ){ return db->lookaside.sz; }else{ return sqlite4MallocSize(db->pEnv, p); } } /* ** Free memory previously obtained from sqlite4Malloc(). */ void sqlite4_free(sqlite4_env *pEnv, void *p){ if( p==0 ) return; /* IMP: R-49053-54554 */ assert( sqlite4MemdebugNoType(p, MEMTYPE_DB) ); assert( sqlite4MemdebugHasType(p, MEMTYPE_HEAP) ); if( pEnv==0 ) pEnv = &sqlite4DefaultEnv; sqlite4_mm_free(pEnv->pMM, p); } /* ** Free memory that might be associated with a particular database ** connection. */ void sqlite4DbFree(sqlite4 *db, void *p){ |
︙ | ︙ | |||
185 186 187 188 189 190 191 | sqlite4_free(db==0 ? 0 : db->pEnv, p); } /* ** Change the size of an existing memory allocation */ void *sqlite4Realloc(sqlite4_env *pEnv, void *pOld, int nBytes){ | < < < < < < < < < < < < < | < < < < < | < | 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 | sqlite4_free(db==0 ? 0 : db->pEnv, p); } /* ** Change the size of an existing memory allocation */ void *sqlite4Realloc(sqlite4_env *pEnv, void *pOld, int nBytes){ if( pEnv==0 ) pEnv = &sqlite4DefaultEnv; if( pOld==0 ){ return sqlite4Malloc(pEnv, nBytes); /* IMP: R-28354-25769 */ } if( nBytes<=0 ){ sqlite4_free(pEnv, pOld); /* IMP: R-31593-10574 */ return 0; } if( nBytes>=0x7fffff00 ){ /* The 0x7ffff00 limit term is explained in comments on sqlite4Malloc() */ return 0; } return sqlite4_mm_realloc(pEnv->pMM, pOld, nBytes); } /* ** The public interface to sqlite4Realloc. Make sure that the memory ** subsystem is initialized prior to invoking sqliteRealloc. */ void *sqlite4_realloc(sqlite4_env *pEnv, void *pOld, sqlite4_size_t n){ #ifndef SQLITE4_OMIT_AUTOINIT if( sqlite4_initialize(pEnv) ) return 0; #endif return sqlite4Realloc(pEnv, pOld, (int)n); } /* ** Allocate and zero memory. */ |
︙ | ︙ |
Changes to src/mem1.c.
︙ | ︙ | |||
274 275 276 277 278 279 280 281 282 283 284 285 | sqlite4MemSize, sqlite4MemInit, sqlite4MemShutdown, 0, 0, 0 }; pEnv->m = defaultMethods; pEnv->m.pMemEnv = (void*)pEnv; } #endif /* SQLITE4_SYSTEM_MALLOC */ | > > | 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | sqlite4MemSize, sqlite4MemInit, sqlite4MemShutdown, 0, 0, 0 }; #if 0 pEnv->m = defaultMethods; pEnv->m.pMemEnv = (void*)pEnv; #endif } #endif /* SQLITE4_SYSTEM_MALLOC */ |
Changes to src/sqlite.h.in.
︙ | ︙ | |||
125 126 127 128 129 130 131 | /* ** Return a pointer to the default memory allocator, which is basically ** a wrapper around system malloc()/realloc()/free(). */ sqlite4_mm *sqlite4_mm_default(void); | < < < < < < < | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | /* ** Return a pointer to the default memory allocator, which is basically ** a wrapper around system malloc()/realloc()/free(). */ sqlite4_mm *sqlite4_mm_default(void); /* ** Allocate a new memory manager. Return NULL if unable. */ sqlite4_mm *sqlite4_mm_new(sqlite4_mm_type, ...); /* ** Free the sqlite4_mm object. |
︙ | ︙ | |||
259 260 261 262 263 264 265 | #define SQLITE4_ENVCONFIG_MALLOC 7 /* sqlite4_mem_methods* */ #define SQLITE4_ENVCONFIG_GETMALLOC 8 /* sqlite4_mem_methods* */ #define SQLITE4_ENVCONFIG_MEMSTATUS 9 /* boolean */ #define SQLITE4_ENVCONFIG_LOOKASIDE 10 /* size, count */ #define SQLITE4_ENVCONFIG_LOG 11 /* xLog, pArg */ #define SQLITE4_ENVCONFIG_KVSTORE_PUSH 12 /* name, factory */ #define SQLITE4_ENVCONFIG_KVSTORE_POP 13 /* name */ | | | 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | #define SQLITE4_ENVCONFIG_MALLOC 7 /* sqlite4_mem_methods* */ #define SQLITE4_ENVCONFIG_GETMALLOC 8 /* sqlite4_mem_methods* */ #define SQLITE4_ENVCONFIG_MEMSTATUS 9 /* boolean */ #define SQLITE4_ENVCONFIG_LOOKASIDE 10 /* size, count */ #define SQLITE4_ENVCONFIG_LOG 11 /* xLog, pArg */ #define SQLITE4_ENVCONFIG_KVSTORE_PUSH 12 /* name, factory */ #define SQLITE4_ENVCONFIG_KVSTORE_POP 13 /* name */ #define SQLITE4_ENVCONFIG_KVSTORE_GET 14 /* name, *factory */ /* ** CAPIREF: Compile-Time Library Version Numbers ** ** ^(The [SQLITE4_VERSION] C preprocessor macro in the sqlite4.h header ** evaluates to a string literal that is the SQLite version in the ** format "X.Y.Z" where X is the major version number (always 3 for |
︙ | ︙ | |||
1193 1194 1195 1196 1197 1198 1199 | ** a block of memory after it has been released using ** [sqlite4_free()] or [sqlite4_realloc()]. */ void *sqlite4_malloc(sqlite4_env*, sqlite4_size_t); void *sqlite4_realloc(sqlite4_env*, void*, sqlite4_size_t); void sqlite4_free(sqlite4_env*, void*); | < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 | ** a block of memory after it has been released using ** [sqlite4_free()] or [sqlite4_realloc()]. */ void *sqlite4_malloc(sqlite4_env*, sqlite4_size_t); void *sqlite4_realloc(sqlite4_env*, void*, sqlite4_size_t); void sqlite4_free(sqlite4_env*, void*); /* ** CAPIREF: Pseudo-Random Number Generator ** ** ^A call to this routine stores N bytes of pseudo-randomness into buffer P. */ void sqlite4_randomness(sqlite4_env*, int N, void *P); |
︙ | ︙ | |||
2569 2570 2571 2572 2573 2574 2575 | void *sqlite4_aggregate_context(sqlite4_context*, int nBytes); /* ** CAPIREF: User Data For Functions ** ** ^The sqlite4_user_data() interface returns a copy of ** the pointer that was the pUserData parameter (the 5th parameter) | | < | | | | 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 | void *sqlite4_aggregate_context(sqlite4_context*, int nBytes); /* ** CAPIREF: User Data For Functions ** ** ^The sqlite4_user_data() interface returns a copy of ** the pointer that was the pUserData parameter (the 5th parameter) ** passed to the [sqlite4_create_function()] or [sqlite4_create_function16()] ** call that registered the application defined function. ** ** This routine must be called from the same thread in which the ** application-defined function is running. */ void *sqlite4_user_data(sqlite4_context*); /* ** CAPIREF: Database Connection For Functions ** ** ^The sqlite4_context_db_handle() interface returns a copy of |
︙ | ︙ | |||
2787 2788 2789 2790 2791 2792 2793 | void sqlite4_result_text16le(sqlite4_context*, const void*, int, void(*)(void*,void*),void*); void sqlite4_result_text16be(sqlite4_context*, const void*, int, void(*)(void*,void*),void*); void sqlite4_result_value(sqlite4_context*, sqlite4_value*); /* | | | 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 | void sqlite4_result_text16le(sqlite4_context*, const void*, int, void(*)(void*,void*),void*); void sqlite4_result_text16be(sqlite4_context*, const void*, int, void(*)(void*,void*),void*); void sqlite4_result_value(sqlite4_context*, sqlite4_value*); /* ** CAPIREF: Define New Collation Sequences ** ** ^This function adds, removes, or modifies a [collation] associated ** with the [database connection] specified as the first argument. ** ** ^The name of the collation is a UTF-8 string. ** ^Collation names that compare equal according to [sqlite4_strnicmp()] are ** considered to be the same name. |
︙ | ︙ |
Changes to src/sqliteInt.h.
︙ | ︙ | |||
2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 | int bMemstat; /* True to enable memory status */ int bCoreMutex; /* True to enable core mutexing */ int bFullMutex; /* True to enable full mutexing */ int mxStrlen; /* Maximum string length */ int szLookaside; /* Default lookaside buffer size */ int nLookaside; /* Default lookaside buffer count */ sqlite4_mm *pMM; /* Memory allocator for this environment */ sqlite4_mem_methods m; /* Low-level memory allocation interface */ sqlite4_mutex_methods mutex; /* Low-level mutex interface */ void *pHeap; /* Heap storage space */ int nHeap; /* Size of pHeap[] */ int mnReq, mxReq; /* Min and max heap requests sizes */ int mxParserStack; /* maximum depth of the parser stack */ KVFactory *pFactory; /* List of factories */ int (*xRandomness)(sqlite4_env*, int, unsigned char*); | > > | 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 | int bMemstat; /* True to enable memory status */ int bCoreMutex; /* True to enable core mutexing */ int bFullMutex; /* True to enable full mutexing */ int mxStrlen; /* Maximum string length */ int szLookaside; /* Default lookaside buffer size */ int nLookaside; /* Default lookaside buffer count */ sqlite4_mm *pMM; /* Memory allocator for this environment */ #if 0 sqlite4_mem_methods m; /* Low-level memory allocation interface */ #endif sqlite4_mutex_methods mutex; /* Low-level mutex interface */ void *pHeap; /* Heap storage space */ int nHeap; /* Size of pHeap[] */ int mnReq, mxReq; /* Min and max heap requests sizes */ int mxParserStack; /* maximum depth of the parser stack */ KVFactory *pFactory; /* List of factories */ int (*xRandomness)(sqlite4_env*, int, unsigned char*); |
︙ | ︙ |
Changes to test/test_malloc.c.
︙ | ︙ | |||
472 473 474 475 476 477 478 | size -= n; sqlite4TestBinToHex(zHex, n); Tcl_AppendResult(interp, zHex, (char*)0); } return TCL_OK; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 472 473 474 475 476 477 478 479 480 481 482 483 484 485 | size -= n; sqlite4TestBinToHex(zHex, n); Tcl_AppendResult(interp, zHex, (char*)0); } return TCL_OK; } /* ** Usage: sqlite4_memdebug_backtrace DEPTH ** ** Set the depth of backtracing. If SQLITE4_MEMDEBUG is not defined ** then this routine is a no-op. */ static int test_memdebug_backtrace( |
︙ | ︙ | |||
1170 1171 1172 1173 1174 1175 1176 | int clientData; } aObjCmd[] = { { "sqlite4_malloc", test_malloc ,0 }, { "sqlite4_realloc", test_realloc ,0 }, { "sqlite4_free", test_free ,0 }, { "memset", test_memset ,0 }, { "memget", test_memget ,0 }, | < < | 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 | int clientData; } aObjCmd[] = { { "sqlite4_malloc", test_malloc ,0 }, { "sqlite4_realloc", test_realloc ,0 }, { "sqlite4_free", test_free ,0 }, { "memset", test_memset ,0 }, { "memget", test_memget ,0 }, { "sqlite4_memdebug_backtrace", test_memdebug_backtrace ,0 }, { "sqlite4_memdebug_dump", test_memdebug_dump ,0 }, { "sqlite4_memdebug_fail", test_memdebug_fail ,0 }, { "sqlite4_memdebug_pending", test_memdebug_pending ,0 }, { "sqlite4_memdebug_settitle", test_memdebug_settitle ,0 }, { "sqlite4_memdebug_malloc_count", test_memdebug_malloc_count ,0 }, { "sqlite4_memdebug_log", test_memdebug_log ,0 }, |
︙ | ︙ |
Changes to test/tester.tcl.
︙ | ︙ | |||
759 760 761 762 763 764 765 | puts "in your TCL build." puts "******************************************************************" } if {$::cmdlinearg(binarylog)} { vfslog finalize binarylog } kvwrap uninstall | | | | | | | | | < > | | | | < < > > | | | 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 | puts "in your TCL build." puts "******************************************************************" } if {$::cmdlinearg(binarylog)} { vfslog finalize binarylog } kvwrap uninstall # if {[lindex [sqlite4_env_status SQLITE4_ENVSTATUS_MALLOC_COUNT 0] 1]>0 || # [sqlite4_memory_used]>0} { # puts "Unfreed memory: [sqlite4_memory_used] bytes in\ # [lindex [sqlite4_env_status SQLITE4_ENVSTATUS_MALLOC_COUNT 0] 1] allocations" # incr nErr # ifcapable memdebug||mem5||(mem3&&debug) { # puts "Writing unfreed memory log to \"./memleak.txt\"" # sqlite4_memdebug_dump ./memleak.txt # } # } else { # puts "All memory allocations freed - no leaks" # ifcapable memdebug||mem5 { # sqlite4_memdebug_dump ./memusage.txt # } # } show_memstats #puts "Maximum memory usage: [sqlite4_memory_highwater 1] bytes" #puts "Current memory usage: [sqlite4_memory_highwater] bytes" if {[info commands sqlite4_memdebug_malloc_count] ne ""} { puts "Number of malloc() : [sqlite4_memdebug_malloc_count] calls" } if {$::cmdlinearg(malloctrace)} { puts "Writing malloc() report to malloc.txt..." testmem report malloc.txt } |
︙ | ︙ |