Changeset 218

Show
Ignore:
Timestamp:
02/07/07 21:59:32 (1 year ago)
Author:
ug
Message:

Add option about cache size to GameList? constructor

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 06/libkombilo/search.cpp

    r217 r218  
    33783378} 
    33793379 
    3380 GameList::GameList(char* DBNAME, string ORDERBY, string FORMAT, ProcessOptions* p_options) throw(DBError) { 
     3380GameList::GameList(char* DBNAME, string ORDERBY, string FORMAT, ProcessOptions* p_options, int cache) throw(DBError) { 
    33813381  labels = 0; 
    33823382  continuations = 0; 
     
    33973397  rc = sqlite3_exec(algo_db1, "pragma synchronous = off;", 0, 0, 0); 
    33983398  if (rc) throw DBError(); 
    3399   rc = sqlite3_exec(algo_db1, "pragma cache_size = 100000;", 0, 0, 0); 
     3399  char cache_str[100]; 
     3400  sprintf(cache_str, "pragma cache_size = %d", cache*1000); 
     3401  rc = sqlite3_exec(algo_db1, cache_str, 0, 0, 0); 
    34003402  if (rc) throw DBError(); 
    34013403  dbname[strlen(DBNAME)] = '2'; 
     
    34113413  rc = sqlite3_exec(algo_db2, "pragma synchronous = off;", 0, 0, 0); 
    34123414  if (rc) throw DBError(); 
    3413   rc = sqlite3_exec(algo_db2, "pragma cache_size = 700000;", 0, 0, 0); 
     3415  sprintf(cache_str, "pragma cache_size = %d", cache*7000); 
     3416  rc = sqlite3_exec(algo_db1, cache_str, 0, 0, 0); 
    34143417  if (rc) throw DBError(); 
    34153418 
     
    34263429  rc = sqlite3_exec(db, "pragma synchronous = off;", 0, 0, 0); 
    34273430  if (rc) throw DBError(); 
    3428   rc = sqlite3_exec(db, "pragma cache_size = 100000;", 0, 0, 0); 
     3431  sprintf(cache_str, "pragma cache_size = %d", cache*1000); 
     3432  rc = sqlite3_exec(algo_db1, cache_str, 0, 0, 0); 
    34293433  if (rc) throw DBError(); 
    34303434 
  • 06/libkombilo/search.h

    r217 r218  
    590590    // ------- constructor -------------------------------------------------------- 
    591591    // p_options will be copied by GameList, so the caller has to free the pointer 
    592     GameList(char* DBNAME, std::string ORDERBY="", std::string FORMAT="", ProcessOptions* p_options=0) throw(DBError); 
     592    GameList(char* DBNAME, std::string ORDERBY="", std::string FORMAT="", ProcessOptions* p_options=0, int cache=100) throw(DBError); 
    593593 
    594594    // ------- processing SGF games (to populate the db) --------------------------