diff options
author | Tobin Ehlis <tobine@google.com> | 2019-08-23 07:26:25 -0600 |
---|---|---|
committer | Tobin Ehlis <tobine@google.com> | 2019-08-23 17:09:59 -0600 |
commit | c8887f81511c334468b66a01e6fc333de8b18984 (patch) | |
tree | 2a6e37f1b01579d383c64d638734cc34a9eaad7d | |
parent | 40c831cc119246d371d1eea8800b2ca3f22650b0 (diff) | |
download | vulkan-validation-layers-c8887f81511c334468b66a01e6fc333de8b18984.tar.gz |
layers:Fix struct padding
Always pad lock struct out to next 64-bytes.
On Windows x64 std::mutex may be 80 bytes and updated padding code
handles case where sizeof(lock_t) is > 64.
-rw-r--r-- | layers/vk_layer_utils.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/layers/vk_layer_utils.h b/layers/vk_layer_utils.h index 04031fcb7..b08d30de2 100644 --- a/layers/vk_layer_utils.h +++ b/layers/vk_layer_utils.h @@ -306,7 +306,7 @@ class vl_concurrent_unordered_map { struct { lock_t lock; // Put each lock on its own cache line to avoid false cache line sharing. - char padding[64 - sizeof(lock_t)]; + char padding[(-int(sizeof(lock_t))) & 63]; } locks[BUCKETS]; uint32_t ConcurrentMapHashObject(const Key &object) const { |