From 86a60985ecd84a7230d5a2ce2373fed92f16d0c6 Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Sat, 11 May 2019 20:52:45 +0100 Subject: [PATCH] Revert "Add in poor man's lru_caching to see if it's the caching or lru_cache itself." This reverts commit 48826a9051f1bf62817a639d7414dc4f6b55ebef. --- volatility/framework/layers/physical.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/volatility/framework/layers/physical.py b/volatility/framework/layers/physical.py index 5bc7649a0..4c6efb0eb 100644 --- a/volatility/framework/layers/physical.py +++ b/volatility/framework/layers/physical.py @@ -18,7 +18,6 @@ # specific language governing rights and limitations under the License. # import threading -from collections import OrderedDict from typing import Any, Dict, IO, List, Optional, Union from volatility.framework import exceptions, interfaces, constants @@ -107,7 +106,6 @@ class FileLayer(interfaces.layers.DataLayerInterface): self._lock = DummyLock() # type: Union[DummyLock, threading.Lock] if constants.PARALLELISM == constants.PARALLELISM_THREADING: self._lock = threading.Lock() - self._cache = OrderedDict() # Instantiate the file to throw exceptions if the file doesn't open _ = self._file @@ -158,10 +156,6 @@ class FileLayer(interfaces.layers.DataLayerInterface): raise exceptions.InvalidAddressException(self.name, invalid_address, "Offset outside of the buffer boundaries") - if (length, offset) in self._cache.keys(): - self._cache.move_to_end((length, offset)) - return self._cache[(length, offset)] - # TODO: implement locking for multi-threading with self._lock: self._file.seek(offset) @@ -173,10 +167,6 @@ class FileLayer(interfaces.layers.DataLayerInterface): else: raise exceptions.InvalidAddressException( self.name, offset + len(data), "Could not read sufficient bytes from the " + self.name + " file") - - self._cache[(length, offset)] = data - if len(self._cache) > 1024: - self._cache.popitem(last = True) return data def write(self, offset: int, data: bytes) -> None: