Mercurial > hg > audiodb
comparison 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 |
comparison
equal
deleted
inserted
replaced
173:42585bd03636 | 174:2826339b4e92 |
---|---|
80 // Macros | 80 // Macros |
81 #define O2_ACTION(a) (strcmp(command,a)==0) | 81 #define O2_ACTION(a) (strcmp(command,a)==0) |
82 | 82 |
83 #define ALIGN_UP(x,w) ((x) + ((1<<w)-1) & ~((1<<w)-1)) | 83 #define ALIGN_UP(x,w) ((x) + ((1<<w)-1) & ~((1<<w)-1)) |
84 #define ALIGN_DOWN(x,w) ((x) & ~((1<<w)-1)) | 84 #define ALIGN_DOWN(x,w) ((x) & ~((1<<w)-1)) |
85 | |
86 #define ALIGN_PAGE_UP(x,w) ((x) + (getpagesize()-1) & ~(getpagesize()-1)) | |
87 #define ALIGN_PAGE_DOWN(x,w) ((x) & ~(getpagesize()-1)) | |
85 | 88 |
86 #define ENSURE_STRING(x) ((x) ? (x) : "") | 89 #define ENSURE_STRING(x) ((x) ? (x) : "") |
87 | 90 |
88 using namespace std; | 91 using namespace std; |
89 | 92 |