diff options
author | Sami Tolvanen <samitolvanen@google.com> | 2015-10-29 15:45:17 +0000 |
---|---|---|
committer | Sami Tolvanen <samitolvanen@google.com> | 2015-10-29 15:54:27 +0000 |
commit | dadd5e33ac00df9a57114487f8441a59fd08bd89 (patch) | |
tree | 29acb8d24f4a66a8ba09c0a1763ce741bca4fde4 /libfec/fec_private.h | |
parent | 4ea2a41464237deabff29bd29a9ffb621ac9f7af (diff) | |
download | extras-dadd5e33ac00df9a57114487f8441a59fd08bd89.tar.gz |
libfec: remove verity validation cache
Caching block validation results increases libfec memory usage and
does not provide comparable benefits in normal use cases, which do
not involve re-reading the same blocks.
Change-Id: I71ac47a7059b350b16e32207932004f3f147abcb
Diffstat (limited to 'libfec/fec_private.h')
-rw-r--r-- | libfec/fec_private.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/libfec/fec_private.h b/libfec/fec_private.h index 21758990..bde30bd8 100644 --- a/libfec/fec_private.h +++ b/libfec/fec_private.h @@ -19,7 +19,6 @@ #include <errno.h> #include <fcntl.h> -#include <list> #include <memory> #include <new> #include <pthread.h> @@ -28,7 +27,6 @@ #include <string.h> #include <sys/syscall.h> #include <unistd.h> -#include <unordered_map> #include <vector> #include <utils/Compat.h> @@ -103,8 +101,6 @@ struct fec_handle { int flags; /* additional flags passed to fec_open */ int mode; /* mode for open(2) */ pthread_mutex_t mutex; - std::list<verity_block_info> lru; - std::unordered_map<uint64_t, std::list<verity_block_info>::iterator> cache; uint64_t errors; uint64_t data_size; uint64_t pos; @@ -131,8 +127,8 @@ extern uint64_t verity_get_size(uint64_t file_size, uint32_t *verity_levels, extern int verity_parse_header(fec_handle *f, uint64_t offset); -extern bool verity_check_block(fec_handle *f, uint64_t index, - const uint8_t *expected, const uint8_t *block); +extern bool verity_check_block(fec_handle *f, const uint8_t *expected, + const uint8_t *block); /* helper macros */ #ifndef unlikely |