mirror of
https://github.com/ARM-software/devlib.git
synced 2025-07-26 07:29:10 +01:00
utils: added a function to reset memoized cache
Added a function to reset the memo cache used by memoized decorator, which would force all memoized functions to re-evalued their results when they are next called. This is primarily intended for debugging.
This commit is contained in:
@@ -537,6 +537,10 @@ def mask_to_list(mask):
|
||||
__memo_cache = {}
|
||||
|
||||
|
||||
def reset_memo_cache():
|
||||
__memo_cache.clear()
|
||||
|
||||
|
||||
@wrapt.decorator
|
||||
def memoized(wrapped, instance, args, kwargs):
|
||||
"""A decorator for memoizing functions and methods."""
|
||||
|
Reference in New Issue
Block a user