Database
mm_emdb.txt
Associated article: Memory Management & Embedded Databases
Tags: Database Design
Published source code accompanying the article by Andrei Gorine and Konstantin Knizhnik in which they show how embedded and in-memory databases depend on the quality of their memory-management algorithms.
Memory Management & Embedded Databases
by Andrei Gorine and Konstantin Knizhnik
Example 1:
const int storage::block_chain[32] = {
0, 0, 1, 2, 3, 4, 5, 6, 7, 8,
9, 9, 10, 10, 10, 10, 11, 11, 11, 11,
11, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12
};
const int storage::block_size[32] = {
16, 16, 24, 32, 40, 48, 56, 64, 72, 80,
96, 96, 128, 128, 128, 128, 168, 168, 168, 168,
168, 256, 256, 256, 256, 256, 256, 256, 256, 256,
256, 256
};
Listing One
template<class T>
class fixed_size_object_allocator {
protected:
T* free_chain;
public:
/* allocate ...


