From 96f5c1c73575e2fb118661cbed4175d66c67678f Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Tue, 12 Jul 2011 17:12:30 +0000 Subject: [PATCH] (experimental) LRU cache turned off, safe delete --- DataStructures/NNGrid.h | 16 ++++++++-------- Plugins/RoutePlugin.h | 2 +- Server/RequestHandler.h | 3 ++- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/DataStructures/NNGrid.h b/DataStructures/NNGrid.h index 1af9a00bc..153a62220 100644 --- a/DataStructures/NNGrid.h +++ b/DataStructures/NNGrid.h @@ -557,10 +557,10 @@ private: cellMap.insert(std::make_pair(fileIndex, cellIndex)); } } - - if(cellCache.exists(startIndexInFile)) { - cellCache.fetch(startIndexInFile, cellIndex); - } else { + { +// if(cellCache.exists(startIndexInFile)) { +// cellCache.fetch(startIndexInFile, cellIndex); +// } else { std::ifstream localStream(iif, std::ios::in | std::ios::binary); localStream.seekg(startIndexInFile); localStream.read((char*) &cellIndex[0], 32*32*sizeof(unsigned)); @@ -569,10 +569,10 @@ private: if(cellIndex[cellMap.find(fileIndex)->second] == UINT_MAX) { return; } -#pragma omp critical - { - cellCache.insert(startIndexInFile, cellIndex); - } +//#pragma omp critical +// { +// cellCache.insert(startIndexInFile, cellIndex); +// } } const unsigned position = cellIndex[cellMap.find(fileIndex)->second] + 32*32*sizeof(unsigned) ; diff --git a/Plugins/RoutePlugin.h b/Plugins/RoutePlugin.h index 707456a51..ff6d0809d 100644 --- a/Plugins/RoutePlugin.h +++ b/Plugins/RoutePlugin.h @@ -58,7 +58,7 @@ public: } ~RoutePlugin() { - delete sEngine; + DELETE(sEngine); } std::string GetDescriptor() { return pluginDescriptorString; } diff --git a/Server/RequestHandler.h b/Server/RequestHandler.h index 2a10db4c9..09ff85ab5 100644 --- a/Server/RequestHandler.h +++ b/Server/RequestHandler.h @@ -32,6 +32,7 @@ or see http://www.gnu.org/licenses/agpl.txt. #include "../DataStructures/HashTable.h" #include "../Plugins/BasePlugin.h" #include "../Plugins/RouteParameters.h" +#include "../typedefs.h" namespace http { @@ -43,7 +44,7 @@ public: for(unsigned i = 0; i < _pluginVector.size(); i++) { BasePlugin * tempPointer = _pluginVector[i]; - delete tempPointer; + DELETE( tempPointer ); } }