diff options
author | mistachkin <mistachkin@noemail.net> | 2013-11-23 00:27:29 +0000 |
---|---|---|
committer | mistachkin <mistachkin@noemail.net> | 2013-11-23 00:27:29 +0000 |
commit | ac1f10458b9ab22ee0679ba8e4bff3a046e1a0ca (patch) | |
tree | 765198c408f63847eda56f23dab119dbbfc76d51 /src/test_malloc.c | |
parent | 20b859530b304b11fe717647cc245d30f370606b (diff) | |
download | sqlite-ac1f10458b9ab22ee0679ba8e4bff3a046e1a0ca.tar.gz sqlite-ac1f10458b9ab22ee0679ba8e4bff3a046e1a0ca.zip |
Add experimental sqlite3_config option to control the native Win32 heap size.
FossilOrigin-Name: f09f11e94b5a7c2e51d99c3700d2acd2f3903de9
Diffstat (limited to 'src/test_malloc.c')
-rw-r--r-- | src/test_malloc.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/test_malloc.c b/src/test_malloc.c index f513e24bf..0c2d6ba22 100644 --- a/src/test_malloc.c +++ b/src/test_malloc.c @@ -1131,6 +1131,33 @@ static int test_config_heap( } /* +** Usage: sqlite3_config_heap_size NBYTE +*/ +static int test_config_heap_size( + void * clientData, + Tcl_Interp *interp, + int objc, + Tcl_Obj *CONST objv[] +){ + int nByte; /* Size to pass to sqlite3_config() */ + int rc; /* Return code of sqlite3_config() */ + + Tcl_Obj * CONST *aArg = &objv[1]; + int nArg = objc-1; + + if( nArg!=1 ){ + Tcl_WrongNumArgs(interp, 1, objv, "NBYTE"); + return TCL_ERROR; + } + if( Tcl_GetIntFromObj(interp, aArg[0], &nByte) ) return TCL_ERROR; + + rc = sqlite3_config(SQLITE_CONFIG_HEAP_SIZE, nByte); + + Tcl_SetResult(interp, (char *)sqlite3ErrName(rc), TCL_VOLATILE); + return TCL_OK; +} + +/* ** Usage: sqlite3_config_error [DB] ** ** Invoke sqlite3_config() or sqlite3_db_config() with invalid @@ -1473,6 +1500,7 @@ int Sqlitetest_malloc_Init(Tcl_Interp *interp){ { "sqlite3_db_status", test_db_status ,0 }, { "install_malloc_faultsim", test_install_malloc_faultsim ,0 }, { "sqlite3_config_heap", test_config_heap ,0 }, + { "sqlite3_config_heap_size", test_config_heap_size ,0 }, { "sqlite3_config_memstatus", test_config_memstatus ,0 }, { "sqlite3_config_lookaside", test_config_lookaside ,0 }, { "sqlite3_config_error", test_config_error ,0 }, |