ResCache::~ResCache() { while (!m_lruResources.empty()) { FreeOneResource(); } }
ResCache::~ResCache() { while (!m_lru.empty()) { FreeOneResource(); } SAFE_DELETE(m_file); }
ResourceManager::~ResourceManager() { while (!this->lru.empty()) { FreeOneResource(); } this->resources.clear(); }
//************************************ // Method: MakeRoom // FullName: ResCache::MakeRoom // Access: protected // Returns: bool // Qualifier: // Parameter: unsigned int size //************************************ bool ResCache::MakeRoom(unsigned int size) { if(size > m_cacheSize) { return false; } while(size >(m_cacheSize - m_allocated)) { if (m_lru.empty()) return false; FreeOneResource(); } return true; }
bool ResourceCache::MakeRoom(unsigned int uSize) { if (uSize > m_uCacheSize) { return false; } while (uSize > (m_uCacheSize - m_uAllocated)) { //cache is empty and it's still not enough room to allocated the resource if (m_lru.empty()) return false; FreeOneResource(); } return true; }
bool ResCache::MakeRoom(unsigned int size) { if (size > m_cacheSize) { return false; } // return null if there's no possible way to allocate the memory while (size > (m_cacheSize - m_allocated)) { // The cache is empty, and there's still not enough room. if (m_lruResources.empty()) return false; FreeOneResource(); } return true; }
bool ResourceManager::MakeRoom(unsigned int size) { if (size > this->cacheSize) { return false; } while (size > (this->cacheSize - this->allocatedSize)) { if (this->lru.empty()) { // The cache is empty, and there's still not enough room. return false; } FreeOneResource(); } return true; }