Commit Graph

3 Commits

Author SHA1 Message Date
Tom Cherry b6cb992cf3 logd: replace std::vector<uint8_t> in SerializedLogChunk
Turns out std::vector::resize() and std::vector::clear() don't
actually deallocate any memory.  std::vector::shrink_to_fit() can be
used for this but isn't a 'guarantee'.  Instead of trying to get
std::vector to play nice, this change replaces std::vector<uint8_t>
with std::unique_ptr<uint8_t[]>, which is more accurate to how I'm
using this memory anyway.

Test: logging unit tests
Change-Id: I9638e90bbf50bcf316c5aa172c8278ea945d27e7
2020-06-24 16:19:28 -07:00
Tom Cherry 4f9fed24bc logd: add missing static to CompressionEngine
Test: build
Change-Id: I8b068e137835ce5e1ce2af1911f557cbcaca0fa2
2020-06-17 08:31:25 -07:00
Tom Cherry 1a796bca57 logd: add a SerializedLogBuffer suitable for compression
Initial commit for a SerializedLogBuffer.  The intention here is for
the serialized data to be compressed (currently using zlib) to allow
for substantially longer logs in the same memory footprint.

Test: unit tests
Change-Id: I2528e4e1ff1cf3bc91130173a107f371f04d911a
2020-06-12 14:35:30 -07:00