Skip to content

Commit 4e0beda

Browse files
authored
Merge pull request #1768 from volatilityfoundation/extensions/process_layer_caching
Extensions: Add cache decorators as appropriate
2 parents 1b31357 + 03e7506 commit 4e0beda

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

volatility3/framework/symbols/linux/extensions/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ def is_valid(self) -> bool:
471471

472472
return True
473473

474+
@functools.lru_cache
474475
def add_process_layer(
475476
self, config_prefix: Optional[str] = None, preferred_name: Optional[str] = None
476477
) -> Optional[str]:

volatility3/framework/symbols/mac/extensions/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# which is available at https://www.volatilityfoundation.org/license/vsl-v1.0
33
#
44
import contextlib
5+
import functools
56
import logging
67
from typing import Generator, Iterable, Optional, Set, Tuple
78

@@ -17,6 +18,7 @@ class proc(generic.GenericIntelProcess):
1718
def get_task(self):
1819
return self.task.dereference().cast("task")
1920

21+
@functools.lru_cache
2022
def add_process_layer(
2123
self, config_prefix: Optional[str] = None, preferred_name: Optional[str] = None
2224
) -> Optional[str]:

volatility3/framework/symbols/windows/extensions/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,10 @@ def is_valid(self) -> bool:
740740

741741
return True
742742

743+
@functools.lru_cache
743744
def add_process_layer(
744745
self, config_prefix: Optional[str] = None, preferred_name: Optional[str] = None
745-
):
746+
) -> str:
746747
"""Constructs a new layer based on the process's DirectoryTableBase."""
747748

748749
parent_layer = self._context.layers[self.vol.layer_name]

0 commit comments

Comments
 (0)