aboutsummaryrefslogtreecommitdiffstats
path: root/src/algo_factory/algo_factory.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-07-27 21:18:33 +0000
committerlloyd <[email protected]>2010-07-27 21:18:33 +0000
commit0c0655ea9c97618716fe2f11355e81b6f6a7a81b (patch)
tree0aae42e3071d83f8056e9e0f9bd630618feff6a5 /src/algo_factory/algo_factory.cpp
parent3531f7981256d7ff45cdcb4c96d4f339c0db1b93 (diff)
Expose Algorithm_Factory::clear_caches which clears out all of the
caches; this might be useful for applications which are, say, particularly sensitive to memory usage.
Diffstat (limited to 'src/algo_factory/algo_factory.cpp')
-rw-r--r--src/algo_factory/algo_factory.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/algo_factory/algo_factory.cpp b/src/algo_factory/algo_factory.cpp
index 16ac589a1..6bd66d349 100644
--- a/src/algo_factory/algo_factory.cpp
+++ b/src/algo_factory/algo_factory.cpp
@@ -108,13 +108,17 @@ Algorithm_Factory::~Algorithm_Factory()
std::for_each(engines.begin(), engines.end(), del_fun<Engine>());
}
-void Algorithm_Factory::add_engine(Engine* engine)
+void Algorithm_Factory::clear_caches()
{
block_cipher_cache->clear_cache();
stream_cipher_cache->clear_cache();
hash_cache->clear_cache();
mac_cache->clear_cache();
+ }
+void Algorithm_Factory::add_engine(Engine* engine)
+ {
+ clear_caches();
engines.push_back(engine);
}