/* ** This function is called during initialization (sqlite3_initialize()) to ** install the default pluggable cache module, assuming the user has not ** already provided an alternative. */ static void sqlite3PCacheSetDefault() { sqlite3_pcache_methods defaultMethods = new sqlite3_pcache_methods( 0, /* pArg */ (dxPC_Init)pcache1Init, /* xInit */ (dxPC_Shutdown)pcache1Shutdown, /* xShutdown */ (dxPC_Create)pcache1Create, /* xCreate */ (dxPC_Cachesize)pcache1Cachesize, /* xCachesize */ (dxPC_Pagecount)pcache1Pagecount, /* xPagecount */ (dxPC_Fetch)pcache1Fetch, /* xFetch */ (dxPC_Unpin)pcache1Unpin, /* xUnpin */ (dxPC_Rekey)pcache1Rekey, /* xRekey */ (dxPC_Truncate)pcache1Truncate, /* xTruncate */ (dxPC_Destroy)pcache1Destroy /* xDestroy */ ); sqlite3_config(SQLITE_CONFIG_PCACHE, defaultMethods); }
/* ** This function is called during initialization (sqlite3_initialize()) to ** install the default pluggable cache module, assuming the user has not ** already provided an alternative. */ private static void sqlite3PCacheSetDefault() { var defaultMethods = new sqlite3_pcache_methods( 0, /* pArg */ pcache1Init, /* xInit */ pcache1Shutdown, /* xShutdown */ pcache1Create, /* xCreate */ pcache1Cachesize, /* xCachesize */ pcache1Pagecount, /* xPagecount */ pcache1Fetch, /* xFetch */ pcache1Unpin, /* xUnpin */ pcache1Rekey, /* xRekey */ pcache1Truncate, /* xTruncate */ pcache1Destroy /* xDestroy */ ); sqlite3_config(SQLITE_CONFIG_PCACHE, defaultMethods); }
static int sqlite3_config( int op, ref sqlite3_pcache_methods ap ) { // va_list ap; int rc = SQLITE_OK; switch ( op ) { case SQLITE_CONFIG_GETPCACHE: { if ( sqlite3GlobalConfig.pcache.xInit == null ) { sqlite3PCacheSetDefault(); } ap = sqlite3GlobalConfig.pcache;//va_arg(ap, sqlite3_pcache_methods) = sqlite3GlobalConfig.pcache; break; } } return rc; }
/* ** This API allows applications to modify the global configuration of ** the SQLite library at run-time. ** ** This routine should only be called when there are no outstanding ** database connections or memory allocations. This routine is not ** threadsafe. Failure to heed these warnings can lead to unpredictable ** behavior. */ // Overloads for ap assignments static int sqlite3_config( int op, sqlite3_pcache_methods ap ) { // va_list ap; int rc = SQLITE_OK; switch ( op ) { case SQLITE_CONFIG_PCACHE: { /* Specify an alternative malloc implementation */ sqlite3GlobalConfig.pcache = ap; //sqlite3GlobalConfig.pcache = (sqlite3_pcache_methods)va_arg(ap, "sqlite3_pcache_methods"); break; } } return rc; }
/* ** This function is called during initialization (sqlite3_initialize()) to ** install the default pluggable cache module, assuming the user has not ** already provided an alternative. */ static void sqlite3PCacheSetDefault() { sqlite3_pcache_methods defaultMethods = new sqlite3_pcache_methods( 0, /* pArg */ (dxPC_Init)pcache1Init, /* xInit */ (dxPC_Shutdown)pcache1Shutdown, /* xShutdown */ (dxPC_Create)pcache1Create, /* xCreate */ (dxPC_Cachesize)pcache1Cachesize,/* xCachesize */ (dxPC_Pagecount)pcache1Pagecount,/* xPagecount */ (dxPC_Fetch)pcache1Fetch, /* xFetch */ (dxPC_Unpin)pcache1Unpin, /* xUnpin */ (dxPC_Rekey)pcache1Rekey, /* xRekey */ (dxPC_Truncate)pcache1Truncate, /* xTruncate */ (dxPC_Destroy)pcache1Destroy /* xDestroy */ ); sqlite3_config( SQLITE_CONFIG_PCACHE, defaultMethods ); }