mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-10-30 19:44:32 +00:00 
			
		
		
		
	Merge branch 'develop' of https://github.com/paboyle/Grid into develop
This commit is contained in:
		| @@ -395,12 +395,26 @@ void DiskVectorBase<T>::cacheInsert(const unsigned int i, const T &obj) const | |||||||
|     auto &freeInd  = *freePtr_; |     auto &freeInd  = *freePtr_; | ||||||
|     auto &loads    = *loadsPtr_; |     auto &loads    = *loadsPtr_; | ||||||
|  |  | ||||||
|     evict(); |     // cache miss, evict and store | ||||||
|     index[i] = freeInd.top(); |     if (index.find(i) == index.end()) | ||||||
|     freeInd.pop(); |     { | ||||||
|     cache[index.at(i)] = obj; |         evict(); | ||||||
|     loads.push_back(i); |         index[i] = freeInd.top(); | ||||||
|     modified[index.at(i)] = false; |         freeInd.pop(); | ||||||
|  |         cache[index.at(i)] = obj; | ||||||
|  |         loads.push_back(i); | ||||||
|  |         modified[index.at(i)] = false; | ||||||
|  |     } | ||||||
|  |     // cache hit, modify current value | ||||||
|  |     else | ||||||
|  |     { | ||||||
|  |         auto pos = std::find(loads.begin(), loads.end(), i); | ||||||
|  |          | ||||||
|  |         cache[index.at(i)]    = obj; | ||||||
|  |         modified[index.at(i)] = true; | ||||||
|  |         loads.erase(pos); | ||||||
|  |         loads.push_back(i); | ||||||
|  |     } | ||||||
|  |  | ||||||
| #ifdef DV_DEBUG | #ifdef DV_DEBUG | ||||||
|     std::string msg; |     std::string msg; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user