#include <odb.h>
Collaboration diagram for odb_data:

Public Attributes | |
| odb_node_t * | node_base |
| base memory area of the page | |
| odb_index_t * | hash_base |
| base memory of hash table | |
| odb_descr_t * | descr |
| the current state of database | |
| odb_hash_mask_t | hash_mask |
| == descr->size - 1 | |
| unsigned int | sizeof_header |
| from base_memory to odb header | |
| unsigned int | offset_node |
| from base_memory to node array | |
| void * | base_memory |
| base memory of the maped memory | |
| int | fd |
| mmaped memory file descriptor | |
| char * | filename |
| full path name of sample file | |
| int | ref_count |
| reference count | |
| list_head | list |
| hash bucket list | |
this is an in memory only description.
We allow to manage a database inside a mapped file with an "header" of unknown size so odb_open get a parameter to specify the size of this header. A typical use is:
struct header { int etc; ... }; odb_open(&hash, filename, ODB_RW, sizeof(header)); so on this library have no dependency on the header type.
the internal memory layout from base_memory is: the unknown header (sizeof_header) odb_descr_t the node array: (descr->size * sizeof(odb_node_t) entries the hash table: array of odb_index_t indexing the node array (descr->size * BUCKET_FACTOR) entries
|
|
base memory of the maped memory
|
|
|
the current state of database
|
|
|
mmaped memory file descriptor
|
|
|
full path name of sample file
|
|
|
base memory of hash table
|
|
|
== descr->size - 1
|
|
|
hash bucket list
|
|
|
base memory area of the page
|
|
|
from base_memory to node array
|
|
|
reference count
|
|
|
from base_memory to odb header
|
1.4.6