-
Fix initialization of LRU cache keys · 302a9723Nicolas Capens authored
In particular this fixes Blitter::Options state having uninitialized bits after the bitfield, and Blitter::State having uninitialized padding bytes after Options so 'sourceFormat' is 32-bit aligned. Defines a Memset<T> class to be used as the first base class of cache key types, which makes it explicit that their underlying memory will be fully initialized before any member constructors are run. Also adds is_memcmparable<T> for checking if memcmp() can be used to implement operator==() for cache keys. It's equivalent to std::is_trivially_copyable except it provides a fallback for STL implementations that don't support it. Bug: b/134932616 Change-Id: I6569e78b380e67aee02d5bfd39d80d210bd225fd Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/32929 Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Chris Forbes <chrisforbes@google.com> Reviewed-by:
Ben Clayton <bclayton@google.com>
302a9723
×