CernVM-FS
2.12.0
|
#include <sqlitemem.h>
Public Member Functions | |
LookasideBufferArena () | |
~LookasideBufferArena () | |
void * | GetBuffer () |
void | PutBuffer (void *buffer) |
bool | IsEmpty () |
bool | Contains (void *buffer) |
Static Public Attributes | |
static const unsigned | kBufferSize |
static const unsigned | kBuffersPerArena = 128 |
static const unsigned | kArenaSize = kBuffersPerArena * kBufferSize |
static const unsigned | kNoBitmaps = kBuffersPerArena / (sizeof(int) * 8) |
Private Attributes | |
void * | arena_ |
int | freemap_ [kNoBitmaps] |
A continuous chunk of memory from which fixed-sized chunks are given as lookaside buffers to SQlite database connections. A bitmap indicates used and free buffers. One arena serves 128 database connections and assuming less than 10000 concurrently open catalogs, the number of mmap'd regions stays under 100.
Definition at line 93 of file sqlitemem.h.
SqliteMemoryManager::LookasideBufferArena::LookasideBufferArena | ( | ) |
Definition at line 54 of file sqlitemem.cc.
SqliteMemoryManager::LookasideBufferArena::~LookasideBufferArena | ( | ) |
Definition at line 62 of file sqlitemem.cc.
bool SqliteMemoryManager::LookasideBufferArena::Contains | ( | void * | buffer | ) |
Definition at line 45 of file sqlitemem.cc.
void * SqliteMemoryManager::LookasideBufferArena::GetBuffer | ( | ) |
Definition at line 23 of file sqlitemem.cc.
Referenced by SqliteMemoryManager::GetLookasideBuffer().
bool SqliteMemoryManager::LookasideBufferArena::IsEmpty | ( | ) |
Definition at line 36 of file sqlitemem.cc.
void SqliteMemoryManager::LookasideBufferArena::PutBuffer | ( | void * | buffer | ) |
|
private |
An mmap'd memory block.
Definition at line 127 of file sqlitemem.h.
|
private |
Indicates free/used slots. A used slot has its bit set to zero, an unused slot has its bit set to 1.
Definition at line 133 of file sqlitemem.h.
Referenced by LookasideBufferArena().
|
static |
512kB = 128 4kB buffers.
Definition at line 109 of file sqlitemem.h.
|
static |
Accumulates to 4kB.
Definition at line 98 of file sqlitemem.h.
|
static |
Has to be a multiple of the number of bits in the int type. One arena can serve 128 concurrent sqlite database connections.
Definition at line 105 of file sqlitemem.h.
|
static |
Number of bitmap ints for 128 buffers.
Definition at line 113 of file sqlitemem.h.
Referenced by LookasideBufferArena().