~iuPool() { // すべて解放する for( pool::iterator it=m_pool.begin(); it != m_pool.end(); ) { value_ptr p = *it; it = m_pool.erase(it); delete p; } }
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); } }
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); }
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; }
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); }
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]); }
void TestMessage::garbageCollect() { refCount--; if (refCount == 0) { LOG("destroying TestMessage"); tmpool.in(this); } }
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]); }
void StridePrefetcher::read(MemRequest *mreq) { uint paddr = mreq->getPAddr() & defaultMask; bLine *l = buff->readLine(paddr); if(l) { //hit LOG("SP: hit on %08lx", paddr); hit.inc(); mreq->goUpAbs(nextBuffSlot() + hitDelay); learnHit(paddr); return; } penFetchSet::iterator it = pendingFetches.find(paddr); if(it != pendingFetches.end()) { // half-miss LOG("SP: 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); learnHit(paddr); // half-miss is a hit from the learning point of view return; } LOG("SP:miss on %08lx", paddr); miss.inc(); learnMiss(paddr); mreq->goDownAbs(nextBuffSlot() + missDelay, lowerLevel[0]); }
void push(value_ptr ptr) { m_pool.push_back(ptr); }
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(); }
void garbageCollect() { msgPool.in(this); }
void dealloc_node(node* n) { n->~node(); pool_.deallocate(n); }
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); }
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); }
buffer_ptr buffer() { return buffer_ptr(m_pool.get(), m_deleter); }
buffer_ptr buffer(size_t max) { return buffer_ptr(m_pool.get(max), m_deleter); }
static PBTestAckMsg *create(const ProtocolBase *srcPB, const ProtocolBase *dstPB) { PBTestAckMsg *msg = msgPool.out(); msg->setupMessage(srcPB,dstPB,TestAckMsg); return msg; }
void *SmallObject::operator new(size_t size) { return mem_pool.allocate(size); }