当前位置: 首页>>代码示例>>C++>>正文


C++ pool类代码示例

本文整理汇总了C++中pool的典型用法代码示例。如果您正苦于以下问题:C++ pool类的具体用法?C++ pool怎么用?C++ pool使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了pool类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

 ~iuPool()
 {
     // すべて解放する
     for( pool::iterator it=m_pool.begin(); it != m_pool.end(); )
     {
         value_ptr p = *it;
         it = m_pool.erase(it);
         delete p;
     }
 }
开发者ID:srz-zumix,项目名称:iutest,代码行数:10,代码来源:iutest_pool.hpp

示例2: PortID_t

void InterConnection::test() 
{
  TestMessage* t;
  for (ushort i = 0; i < rPolicy->getnRouters(); i++) {
    t = tmpool.out();
    t->init(i, PortID_t(100), 0, PortID_t(101), Message::RCV_AND_PASS);
    t->setSize(100);
    routers[i]->launchMsg(t);
    t = tmpool.out();
    t->init(i, PortID_t(100), 0, PortID_t(101), Message::RCV);
    t->setSize(100);
    routers[i]->launchMsg(t);
  }
}
开发者ID:bugamn,项目名称:esesc,代码行数:14,代码来源:InterConn.cpp

示例3: is_from

 static bool is_from(void * const ptr)
 { //! Equivalent to SingletonPool::p.is_from(chunk); synchronized.
   //! \returns true if chunk is from SingletonPool::is_from(chunk)
   pool_type & p = get_pool();
   details::pool::guard<Mutex> g(p);
   return p.is_from(ptr);
 }
开发者ID:wuxiang,项目名称:elephants,代码行数:7,代码来源:singleton_pool.hpp

示例4: alloc_node

 node* alloc_node(node* lptr, node* rptr, T const& v,
                  tag_t ltag = 0, tag_t rtag = 0)
 {
     node* chunk = pool_.allocate();
     new (chunk) node(lptr, rptr, v, ltag, rtag);
     return chunk;
 }
开发者ID:atrantan,项目名称:hpx,代码行数:7,代码来源:deque.hpp

示例5: LOG

void TestMessage::garbageCollect() 
{
    refCount--;
    if (refCount == 0) {
      LOG("destroying TestMessage");
      tmpool.in(this); 
    }
}
开发者ID:bugamn,项目名称:esesc,代码行数:8,代码来源:InterConn.cpp

示例6: push

 void push(value_ptr ptr) { m_pool.push_back(ptr); }
开发者ID:srz-zumix,项目名称:iutest,代码行数:1,代码来源:iutest_pool.hpp

示例7: purge_memory

 static bool purge_memory()
 { //! Equivalent to SingletonPool::p.purge_memory(); synchronized.
   pool_type & p = get_pool();
   details::pool::guard<Mutex> g(p);
   return p.purge_memory();
 }
开发者ID:wuxiang,项目名称:elephants,代码行数:6,代码来源:singleton_pool.hpp

示例8: dealloc_node

 void dealloc_node(node* n)
 {
     n->~node();
     pool_.deallocate(n);
 }
开发者ID:atrantan,项目名称:hpx,代码行数:5,代码来源:deque.hpp

示例9: ordered_free

 static void ordered_free(void * const ptr, const size_type n)
 { //! Equivalent to SingletonPool::p.ordered_free(chunk, n); synchronized.
   pool_type & p = get_pool();
   details::pool::guard<Mutex> g(p);
   p.ordered_free(ptr, n);
 }
开发者ID:wuxiang,项目名称:elephants,代码行数:6,代码来源:singleton_pool.hpp

示例10: ordered_malloc

 static void * ordered_malloc(const size_type n)
 { //! Equivalent to SingletonPool::p.ordered_malloc(n); synchronized.
   pool_type & p = get_pool();
   details::pool::guard<Mutex> g(p);
   return p.ordered_malloc(n);
 }
开发者ID:wuxiang,项目名称:elephants,代码行数:6,代码来源:singleton_pool.hpp

示例11: buffer

 buffer_ptr buffer()
 {
     return buffer_ptr(m_pool.get(), m_deleter);
 }
开发者ID:hundeboll,项目名称:netmix,代码行数:4,代码来源:buffer_pool.hpp

示例12: new

void *SmallObject::operator new(size_t size)
{
    return mem_pool.allocate(size);
}
开发者ID:wpbest,项目名称:copperspice,代码行数:4,代码来源:smallobject.cpp

示例13: processAck

void TaggedPrefetcher::processAck(PAddr addr)
{
  uint paddr = addr & defaultMask;

  penFetchSet::iterator itF = pendingFetches.find(paddr);
  if(itF == pendingFetches.end()) 
    return;

  bLine *l = buff->fillLine(paddr);

  penReqMapper::iterator it = pendingRequests.find(paddr);

  if(it != pendingRequests.end()) {
    LOG("NLAP: returnAccess [%08lx]", paddr);
    std::queue<MemRequest *> *tmpReqQueue;
    tmpReqQueue = (*it).second;
    while (tmpReqQueue->size()) {
      tmpReqQueue->front()->goUpAbs(nextBuffSlot());
      tmpReqQueue->pop();
    }
    pendingRequests.erase(paddr);
    activeMemReqPool.in(tmpReqQueue);
  }
  pendingFetches.erase(paddr);
}
开发者ID:hdl,项目名称:SuperTrans,代码行数:25,代码来源:TaggedPrefetcher.cpp

示例14: read

void MarkovPrefetcher::read(MemRequest *mreq)
{
  uint32_t paddr = mreq->getPAddr() & defaultMask;
  bLine *l = buff->readLine(paddr);

  if(l) { //hit
    LOG("GHBP: hit on [%08lx]", paddr);
    hit.inc();
    mreq->goUpAbs(nextBuffSlot());
    return;
  }

  penFetchSet::iterator it = pendingFetches.find(paddr);
  if(it != pendingFetches.end()) { // half-miss
    //LOG("GHBP: half-miss on %08lx", paddr);
    halfMiss.inc();
    penReqMapper::iterator itR = pendingRequests.find(paddr);

    if (itR == pendingRequests.end()) {
      pendingRequests[paddr] = activeMemReqPool.out();
      itR = pendingRequests.find(paddr);
    }

    I(itR != pendingRequests.end());
    
    (*itR).second->push(mreq);
    return;
  }

  //LOG("GHBP: miss on [%08lx]", paddr);
  miss.inc();
  mreq->goDown(0, lowerLevel[0]);
}
开发者ID:dilawar,项目名称:sesc,代码行数:33,代码来源:MarkovPrefetcher.cpp

示例15: read

void AlwaysPrefetch::read(MemRequest *mreq)
{
  uint32_t paddr = mreq->getPAddr() & defaultMask;
  bLine *l = buff->readLine(paddr);

  if(l) { //hit
    LOG("NLAP: hit on [%08lx]", (long unsigned int) paddr);
    hit.inc();    
    mreq->goUpAbs(nextBuffSlot());
    return;
  }

  penFetchSet::iterator it = pendingFetches.find(paddr);
  if(it != pendingFetches.end()) { // half-miss
    LOG("NLAP: half-miss on %08lx",(long unsigned int)  paddr);
    penReqMapper::iterator itR = pendingRequests.find(paddr);
    halfMiss.inc();
    if (itR == pendingRequests.end()) {
      pendingRequests[paddr] = activeMemReqPool.out();
      itR = pendingRequests.find(paddr);
    }

    I(itR != pendingRequests.end());
    
    (*itR).second->push(mreq);
    //prefetch(paddr+lineSize, 0); 
    //prefetch( paddr + buff->getLineSize(), 0 ); 
    return;
  }

  LOG("NLAP: miss on [%08lx]", (long unsigned int) paddr);
  miss.inc();

  Time_t lat = nextTableSlot() - globalClock;    

  prefetch(paddr+(buff->getLineSize()), lat);
  lat = nextTableSlot() - globalClock;    
  prefetch(paddr+(2*buff->getLineSize()), lat); 
  mreq->goDown(0, lowerLevel[0]);
}
开发者ID:taiwanese2001,项目名称:sesc-echang,代码行数:40,代码来源:AlwaysPrefetch.cpp


注:本文中的pool类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。