From: Kaj-Michael Lang Date: Tue, 9 Oct 2007 12:28:20 +0000 (+0300) Subject: Use smaller sqlite cache size on tablets and larger on desktops. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a99ab531633b9e5167ac1e06aa71524908f0552c;p=mapper Use smaller sqlite cache size on tablets and larger on desktops. --- diff --git a/src/db.c b/src/db.c index c8045b2..d8449d5 100644 --- a/src/db.c +++ b/src/db.c @@ -49,8 +49,6 @@ gboolean db_connect(sqlite3 **ndb, const gchar *mapper_db) { sqlite3 *db; -printf("%s()\n", __PRETTY_FUNCTION__); - if (ndb && *ndb) db=*ndb; else @@ -71,8 +69,14 @@ if (SQLITE_OK != (sqlite3_open(mapper_db, &db))) { return FALSE; } +/* Use smaller cache as the IT does not have much memory to spare */ +#ifdef WITH_DEVICE_770 +sqlite3_exec(db, "PRAGMA cache_size = 1000;", NULL, NULL, NULL); +#else +sqlite3_exec(db, "PRAGMA cache_size = 8000;", NULL, NULL, NULL); +#endif + *ndb=db; -printf("%s(): return\n", __PRETTY_FUNCTION__); return TRUE; }