diff audioDB.h @ 174:2826339b4e92 no-big-mmap

mmap() the various tables separately on init. Continue mmap()ing the whole database as well, as there is still use of it elsewhere in one or two naughty places. mmap()ing individual tables means aligning to page boundaries; make it so.
author mas01cr
date Wed, 14 Nov 2007 16:32:18 +0000
parents cdd441dcc9a8
children c32bf13c3978
line wrap: on
line diff
--- a/audioDB.h	Wed Nov 14 15:57:15 2007 +0000
+++ b/audioDB.h	Wed Nov 14 16:32:18 2007 +0000
@@ -83,6 +83,9 @@
 #define ALIGN_UP(x,w) ((x) + ((1<<w)-1) & ~((1<<w)-1))
 #define ALIGN_DOWN(x,w) ((x) & ~((1<<w)-1))
 
+#define ALIGN_PAGE_UP(x,w) ((x) + (getpagesize()-1) & ~(getpagesize()-1))
+#define ALIGN_PAGE_DOWN(x,w) ((x) & ~(getpagesize()-1))
+
 #define ENSURE_STRING(x) ((x) ? (x) : "")
 
 using namespace std;