112853Sgabeblack@google.com/***************************************************************************** 212853Sgabeblack@google.com 312853Sgabeblack@google.com Licensed to Accellera Systems Initiative Inc. (Accellera) under one or 412853Sgabeblack@google.com more contributor license agreements. See the NOTICE file distributed 512853Sgabeblack@google.com with this work for additional information regarding copyright ownership. 612853Sgabeblack@google.com Accellera licenses this file to you under the Apache License, Version 2.0 712853Sgabeblack@google.com (the "License"); you may not use this file except in compliance with the 812853Sgabeblack@google.com License. You may obtain a copy of the License at 912853Sgabeblack@google.com 1012853Sgabeblack@google.com http://www.apache.org/licenses/LICENSE-2.0 1112853Sgabeblack@google.com 1212853Sgabeblack@google.com Unless required by applicable law or agreed to in writing, software 1312853Sgabeblack@google.com distributed under the License is distributed on an "AS IS" BASIS, 1412853Sgabeblack@google.com WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 1512853Sgabeblack@google.com implied. See the License for the specific language governing 1612853Sgabeblack@google.com permissions and limitations under the License. 1712853Sgabeblack@google.com 1812853Sgabeblack@google.com *****************************************************************************/ 1912853Sgabeblack@google.com 2012853Sgabeblack@google.com/***************************************************************************** 2112853Sgabeblack@google.com 2212853Sgabeblack@google.com sc_mempool.h - Memory pools for small objects. 2312853Sgabeblack@google.com 2412853Sgabeblack@google.com Original Author: Stan Y. Liao, Synopsys, Inc. 2512853Sgabeblack@google.com 2612853Sgabeblack@google.com CHANGE LOG AT END OF FILE 2712853Sgabeblack@google.com *****************************************************************************/ 2812853Sgabeblack@google.com 2912853Sgabeblack@google.com#ifndef __SYSTEMC_EXT_DT_SC_MEMPOOL_HH__ 3012853Sgabeblack@google.com#define __SYSTEMC_EXT_DT_SC_MEMPOOL_HH__ 3112853Sgabeblack@google.com 3212853Sgabeblack@google.comnamespace sc_core 3312853Sgabeblack@google.com{ 3412853Sgabeblack@google.com 3512853Sgabeblack@google.com// ---------------------------------------------------------------------------- 3612853Sgabeblack@google.com// CLASS : sc_mempool 3712853Sgabeblack@google.com// 3812853Sgabeblack@google.com// ... 3912853Sgabeblack@google.com// ---------------------------------------------------------------------------- 4012853Sgabeblack@google.com 4112853Sgabeblack@google.comclass sc_mempool 4212853Sgabeblack@google.com{ 4312853Sgabeblack@google.com public: 4412853Sgabeblack@google.com static void *allocate(std::size_t sz); 4512853Sgabeblack@google.com static void release(void *p, std::size_t sz); 4612853Sgabeblack@google.com static void display_statistics(); 4712853Sgabeblack@google.com}; 4812853Sgabeblack@google.com 4912853Sgabeblack@google.com// ---------------------------------------------------------------------------- 5012853Sgabeblack@google.com// CLASS : sc_mpobject 5112853Sgabeblack@google.com// 5212853Sgabeblack@google.com// ... 5312853Sgabeblack@google.com// ---------------------------------------------------------------------------- 5412853Sgabeblack@google.com 5512853Sgabeblack@google.comclass sc_mpobject 5612853Sgabeblack@google.com{ 5712853Sgabeblack@google.com public: 5812853Sgabeblack@google.com static void * 5912853Sgabeblack@google.com operator new(std::size_t sz) 6012853Sgabeblack@google.com { 6112853Sgabeblack@google.com return sc_mempool::allocate(sz); 6212853Sgabeblack@google.com } 6312853Sgabeblack@google.com 6412853Sgabeblack@google.com static void 6512853Sgabeblack@google.com operator delete(void *p, std::size_t sz) 6612853Sgabeblack@google.com { 6712853Sgabeblack@google.com sc_mempool::release(p, sz); 6812853Sgabeblack@google.com } 6912853Sgabeblack@google.com 7012853Sgabeblack@google.com static void * 7112853Sgabeblack@google.com operator new [] (std::size_t sz) 7212853Sgabeblack@google.com { 7312853Sgabeblack@google.com return sc_mempool::allocate(sz); 7412853Sgabeblack@google.com } 7512853Sgabeblack@google.com 7612853Sgabeblack@google.com static void 7712853Sgabeblack@google.com operator delete [] (void *p, std::size_t sz) 7812853Sgabeblack@google.com { 7912853Sgabeblack@google.com sc_mempool::release(p, sz); 8012853Sgabeblack@google.com } 8112853Sgabeblack@google.com}; 8212853Sgabeblack@google.com 8312853Sgabeblack@google.com} // namespace sc_core 8412853Sgabeblack@google.com 8512853Sgabeblack@google.com// $Log: sc_mempool.h,v $ 8612853Sgabeblack@google.com// Revision 1.3 2011/08/26 20:46:18 acg 8712853Sgabeblack@google.com// Andy Goodrich: moved the modification log to the end of the file to 8812853Sgabeblack@google.com// eliminate source line number skew when check-ins are done. 8912853Sgabeblack@google.com// 9012853Sgabeblack@google.com// Revision 1.2 2011/02/18 20:38:44 acg 9112853Sgabeblack@google.com// Andy Goodrich: Updated Copyright notice. 9212853Sgabeblack@google.com// 9312853Sgabeblack@google.com// Revision 1.1.1.1 2006/12/15 20:20:06 acg 9412853Sgabeblack@google.com// SystemC 2.3 9512853Sgabeblack@google.com// 9612853Sgabeblack@google.com// Revision 1.3 2006/01/13 18:53:11 acg 9712853Sgabeblack@google.com// Andy Goodrich: Added $Log command so that CVS comments are reproduced in 9812853Sgabeblack@google.com// the source. 9912853Sgabeblack@google.com 10012853Sgabeblack@google.com#endif // __SYSTEMC_EXT_DT_SC_MEMPOOL_HH__ 101