From a99ab531633b9e5167ac1e06aa71524908f0552c Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Tue, 9 Oct 2007 15:28:20 +0300 Subject: [PATCH] Use smaller sqlite cache size on tablets and larger on desktops. --- src/db.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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; } -- 2.39.5