Chromium Code Reviews
DescriptionSafe-browsing SBAddPrefix from vector to deque.
During updates, a large vector of SBAddPrefix is used to make things
more efficient. This may also be leading to memory fragmentation,
because the vector for most users will be around 5MB.
This converts std::vector<SBAddPrefix> uses to std::deque<SBAddPrefix>.
SBAddPrefixContainer is used to make this indirect. The major bits of
this are:
- safe_browsing_store.cc helper functions templated on abstract
containers rather than vectors of abstract items.
- safe_browsing_store_file.cc I/O functions generalized to abstract
containers rather than vectors of abstract items. [It also works
for sets!]
- Convert appropriate cases of iteration-by-index to iterators.
Also revert the following two debuggin changes:
r104974: Histogram large realloc in safe-browsing update.
r105419: Precalculate total size for safe-browsing add_prefixes.
BUG=99056
TEST=Tests, and monitor crash server.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=107415
Patch Set 1 #
Total comments: 14
Patch Set 2 : s/SBAddPrefixContainer/SBAddPrefixes/g #Patch Set 3 : Tweak some naming. #Messages
Total messages: 9 (0 generated)
|