aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/sqlite_utils.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-09 23:41:52 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-09 23:41:52 +0000
commit5a4566af6e715e15ea8dce6776cdc7b9bd03b5bf (patch)
tree762e5cfa9bdd4968207663b15f5f4f1b2a4d2f86 /src/libutil/sqlite_utils.c
parent39bd3efaeab1a4f3236ba68126534c8d73c8f804 (diff)
downloadrspamd-5a4566af6e715e15ea8dce6776cdc7b9bd03b5bf.tar.gz
rspamd-5a4566af6e715e15ea8dce6776cdc7b9bd03b5bf.zip
Use constants instead of magic numbers
Diffstat (limited to 'src/libutil/sqlite_utils.c')
-rw-r--r--src/libutil/sqlite_utils.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libutil/sqlite_utils.c b/src/libutil/sqlite_utils.c
index e1e6f7f76..76a708593 100644
--- a/src/libutil/sqlite_utils.c
+++ b/src/libutil/sqlite_utils.c
@@ -248,7 +248,8 @@ rspamd_sqlite3_wait (rspamd_mempool_t *pool, const gchar *lock)
return TRUE;
}
-
+#define RSPAMD_SQLITE_MMAP_LIMIT 268435456
+#define RSPAMD_SQLITE_CACHE_SIZE 262144
sqlite3 *
rspamd_sqlite3_open_or_create (rspamd_mempool_t *pool, const gchar *path, const
@@ -267,10 +268,12 @@ rspamd_sqlite3_open_or_create (rspamd_mempool_t *pool, const gchar *path, const
foreign_keys[] = "PRAGMA foreign_keys=\"ON\";",
- enable_mmap[] = "PRAGMA mmap_size=268435456;",
+ enable_mmap[] = "PRAGMA mmap_size="
+ G_STRINGIFY(RSPAMD_SQLITE_MMAP_LIMIT) ";",
other_pragmas[] = "PRAGMA read_uncommitted=\"ON\";"
- "PRAGMA cache_size=262144";
+ "PRAGMA cache_size="
+ G_STRINGIFY(RSPAMD_SQLITE_CACHE_SIZE) ";";
gboolean create = FALSE, has_lock = FALSE;
flags = SQLITE_OPEN_READWRITE;