Commit ac1912f1 by Ben Clayton

Yarn: Don't zero-initialize data in Pool<T>::Item::construct()

TIL: For POD type T, `new T` and `new T()` are not the same. new T() will zero initialize, which for large arrays can be very costly. Bug: b/139142453 Change-Id: I9a1a3ef1bb0a167d9955310d1cf331e917019397 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/35569 Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarBen Clayton <bclayton@google.com>
parent a9da772f
...@@ -118,7 +118,7 @@ T* Pool<T>::Item::get() ...@@ -118,7 +118,7 @@ T* Pool<T>::Item::get()
template <typename T> template <typename T>
void Pool<T>::Item::construct() void Pool<T>::Item::construct()
{ {
new (&data) T(); new (&data) T;
} }
template <typename T> template <typename T>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment