クラス sc_core::sc_mempool_int

すべてのメンバ一覧

Public メソッド

 sc_mempool_int (int blksz, int npools, int incr)
 ~sc_mempool_int ()
void * do_allocate (std::size_t)
void do_release (void *, std::size_t)
void display_statistics ()

Private 変数

sc_allocator ** allocators
int num_pools
int increment
int max_size

フレンド

class sc_mempool


説明

sc_mempool.cpp217 行で定義されています。


コンストラクタとデストラクタ

sc_core::sc_mempool_int::sc_mempool_int ( int  blksz,
int  npools,
int  incr 
)

sc_mempool.cpp243 行で定義されています。

00244 {
00245     use_default_new = compute_use_default_new();
00246     if (! use_default_new) {
00247         num_pools = npools;
00248         increment = incr;
00249         max_size = cell_sizes[sizeof(cell_sizes)/sizeof(cell_sizes[0]) - 1];
00250         allocators = new sc_allocator*[npools + 1];
00251         for (int i = 1; i <= npools; ++i)
00252             allocators[i] = new sc_allocator(blksz, cell_sizes[i]);
00253         allocators[0] = allocators[1];
00254     }
00255 }

sc_core::sc_mempool_int::~sc_mempool_int (  ) 

sc_mempool.cpp257 行で定義されています。

00258 {
00259     for (int i = 1; i <= num_pools; ++i)
00260         delete allocators[i];
00261     delete[] allocators;
00262 }


関数

void * sc_core::sc_mempool_int::do_allocate ( std::size_t  sz  ) 

sc_mempool.cpp267 行で定義されています。

00268 {
00269     int which_allocator = cell_size_to_allocator[(sz - 1) / increment + 1];
00270     void* p = allocators[which_allocator]->allocate();
00271     return p;
00272 }

void sc_core::sc_mempool_int::do_release ( void *  p,
std::size_t  sz 
)

sc_mempool.cpp275 行で定義されています。

00276 {
00277     int which_allocator = cell_size_to_allocator[(sz - 1) / increment + 1];
00278     allocators[which_allocator]->release(p);
00279 }

void sc_core::sc_mempool_int::display_statistics (  ) 

sc_mempool.cpp282 行で定義されています。

00283 {
00284     printf("*** Memory Pool Statistics ***\n");
00285     for (int i = 1; i <= num_pools; ++i)
00286         allocators[i]->display_statistics();
00287 }


フレンドと関連する関数

friend class sc_mempool [friend]

sc_mempool.cpp218 行で定義されています。


変数

sc_mempool.cpp229 行で定義されています。

sc_mempool.cpp230 行で定義されています。

sc_mempool.cpp231 行で定義されています。

sc_mempool.cpp232 行で定義されています。


このクラスの説明は次のファイルから生成されました:

SystemCに対してFri Jun 6 20:12:23 2008に生成されました。  doxygen 1.5.6