BLOG | DOCUMENTATION | TRAC

Home --> Documentations --> PJLIB Reference

pj_caching_pool Struct Reference
[Caching Pool Factory]

Data Fields

pj_pool_factory factory
pj_size_t capacity
pj_size_t max_capacity
pj_size_t used_count
pj_size_t used_size
pj_size_t peak_used_size
pj_list free_list [16]
pj_list used_list
char pool_buf [256 *(sizeof(long)/4)]
pj_lock_tlock
unsigned used_count
unsigned used_size
unsigned peak_used_size

Detailed Description

Declaration for caching pool. Application doesn't normally need to care about the contents of this struct, it is only provided here because application need to define an instance of this struct (we can not allocate the struct from a pool since there is no pool factory yet!).

Forward declaration for caching pool, a pool factory implementation.


Field Documentation

Current factory's capacity, i.e. number of bytes that are allocated and available for application in this factory. The factory's capacity represents the size of all pools kept by this factory in it's free list, which will be returned to application when it requests to create a new pool.

Pool factory interface, must be declared first.

Lists of pools in the cache, indexed by pool size.

Maximum size that can be held by this factory. Once the capacity has exceeded max_capacity, further pj_pool_release() will flush the pool. If the capacity is still below the max_capacity, pj_pool_release() will save the pool to the factory's free list.

The maximum size of memory used by application throughout the life of the caching pool.

char pj_caching_pool::pool_buf[256 *(sizeof(long)/4)]

Internal pool.

Number of pools currently held by applications. This number gets incremented everytime pj_pool_create() is called, and gets decremented when pj_pool_release() is called.

List of pools currently allocated by applications.

Total size of memory currently used by application.


The documentation for this struct was generated from the following files:

 


PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.