about summary refs log tree commit diff stats
path: root/miasm2/analysis/depgraph.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2015-08-26 22:35:24 +0200
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2015-08-26 22:35:24 +0200
commitb3d3f8e1befe2dc68b12c4cbd9bdd79661579a2c (patch)
tree7b680ea935af7f99b367d7337bbd9af6b139ad31 /miasm2/analysis/depgraph.py
parent320e24e83c70ceee76bdd146d7f217d3aca6eaa2 (diff)
downloadmiasm-b3d3f8e1befe2dc68b12c4cbd9bdd79661579a2c.tar.gz
miasm-b3d3f8e1befe2dc68b12c4cbd9bdd79661579a2c.zip
Analysis/depgraph: use slots to be memory friendly
Diffstat (limited to 'miasm2/analysis/depgraph.py')
-rw-r--r--miasm2/analysis/depgraph.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/miasm2/analysis/depgraph.py b/miasm2/analysis/depgraph.py
index bbe84f58..72941e1b 100644
--- a/miasm2/analysis/depgraph.py
+++ b/miasm2/analysis/depgraph.py
@@ -25,6 +25,8 @@ class DependencyNode(object):
     line.
     """
 
+    __slots__ = ["_label", "_element", "_line_nb", "_modifier",
+                 "_step", "_nostep_repr", "_hash"]
     def __init__(self, label, element, line_nb, step, modifier=False):
         """Create a dependency node with:
         @label: asm_label instance
@@ -160,6 +162,7 @@ class CacheWrapper(IterableUserDict):
 class DependencyDict(object):
 
     """Internal structure for the DependencyGraph algorithm"""
+    __slots__ = ["_label", "_history", "_pending", "_cache"]
 
     def __init__(self, label, history):
         """Create a DependencyDict
@@ -559,6 +562,8 @@ class DependencyResultImplicit(DependencyResult):
     """Stand for a result of a DependencyGraph with implicit option
 
     Provide path constraints using the z3 solver"""
+    __slots__ = ["_ira", "_depdict", "_input_depnodes", "_graph",
+                 "_has_loop", "_solver"]
 
     # Z3 Solver instance
     _solver = None
@@ -620,6 +625,7 @@ class DependencyResultImplicit(DependencyResult):
 class FollowExpr(object):
 
     "Stand for an element (expression, depnode, ...) to follow or not"
+    __slots__ = ["follow", "element"]
 
     def __init__(self, follow, element):
         self.follow = follow