diff options
author | Tom Cherry <tomcherry@google.com> | 2020-09-18 15:32:32 -0700 |
---|---|---|
committer | Tom Cherry <tomcherry@google.com> | 2020-09-18 15:32:32 -0700 |
commit | 6533fff0e06e9d7f2d54c7abc96fd893f662e1d9 (patch) | |
tree | fdc079680dcc7f1bfcc73d7f9827dbe99c0004fa /trusty/coverage/coverage_test.cpp | |
parent | 691a80ca091e99f088265bda416ccddc236b475e (diff) |
logd: remove min heap in SerializedFlushToState
There was a bug in SerializedFlushToState::Prune() caused by an access
to a SerializedLogEntry raw pointer as a member of a MinHeapElement,
which was deleted earlier in the function.
Instead of just fixing the order of the access and the deletion, I
sought out to remove the raw pointer entirely. In doing so, I noticed
that the min heap doesn't provide significant benefit, since we'll
only ever have 8 log buffers so scalability is not an issue.
Therefore this change removes the min heap entirely and uses the
existing log_position_ and logs_needed_from_next_position_ members to
keep track of which are the next unread logs.
It also adds a smoke test for SerializedFlushToState::Prune() and
additional CHECK() statements to help prevent future errors.
Bug: 168869299
Test: unit tests
Change-Id: Id4d5fdbaff2fe6dc49c38f01e73f900f84d3696b
Diffstat (limited to 'trusty/coverage/coverage_test.cpp')
0 files changed, 0 insertions, 0 deletions