Skip to content

Revert "Feature/use less memory" #1752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions volatility3/framework/interfaces/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import collections.abc
import contextlib
import logging
from typing import Any, List, Mapping, Optional
from typing import Any, Dict, List, Mapping, Optional

from volatility3.framework import constants, interfaces

Expand Down Expand Up @@ -127,11 +127,8 @@ def __init__(
mask = context.layers[object_info.layer_name].address_mask
normalized_offset = object_info.offset & mask

vol = kwargs
vol_info_dict = {"type_name": type_name, "offset": normalized_offset}
vol.update(object_info)
vol.update(vol_info_dict)
self._vol = collections.ChainMap({}, vol)
self._vol = collections.ChainMap({}, vol_info_dict, object_info, kwargs)
self._context = context

def __getattr__(self, attr: str) -> Any:
Expand Down Expand Up @@ -312,9 +309,10 @@ def __init__(self, type_name: str, **arguments) -> None:
"""Stores the keyword arguments for later object creation."""
# Allow the updating of template arguments whilst still in template form
super().__init__()
vol = {"type_name": type_name}
vol.update(arguments)
self._vol = collections.ChainMap({}, vol)
empty_dict: Dict[str, Any] = {}
self._vol = collections.ChainMap(
empty_dict, arguments, {"type_name": type_name}
)

@property
def vol(self) -> ReadOnlyMapping:
Expand Down
Loading