#include <db.h> typedef struct __db_mpoolfile DB_MPOOLFILE;
The memory pool interfaces for the Berkeley DB database environment are methods of the
DB_ENV handle. The
DB_ENV memory pool methods and the
DB_MPOOLFILE
class provide general-purpose, page-oriented buffer
management of files. Although designed to work with the other
DBclasses, they are also useful for more general
purposes. The memory pools are referred to in this document as simply
the cache.
The cache may be shared between processes. The cache is usually filled by pages from one or more files. Pages in the cache are replaced in LRU (least-recently-used) order, with each new page replacing the page that has been unused the longest. Pages retrieved from the cache using DB_MPOOLFILE->get() are pinned in the cache until they are returned to the control of the cache using the DB_MPOOLFILE->put() method.
The DB_MPOOLFILE
object is the handle for a file in the
cache. The handle is not free-threaded. Once the
DB_MPOOLFILE->close() method is called, the handle
may not be accessed again, regardless of that method's return.