chromium/chromium-84-VectorBuffer-fi...

35 lines
1.2 KiB
Diff

From 93b66919d34f977a7d437afc1691f2d8762a350f Mon Sep 17 00:00:00 2001
From: Stephan Hartmann <stha09@googlemail.com>
Date: Mon, 04 May 2020 07:46:46 +0000
Subject: [PATCH] GCC: fix template specialization in WTF::VectorBuffer
GCC complains that explicit specialization in non-namespace scope
is happening for InitInlinedBuffer. However, specialization is
not really necessary here with templates and can be moved
into InitInlinedBuffer method without changing generated code.
Bug: 819294
Change-Id: Ia8060152bf4ba21c85dfc4d99cd7cc64983de077
---
diff --git a/third_party/blink/renderer/platform/wtf/vector.h b/third_party/blink/renderer/platform/wtf/vector.h
index 81a4e7b..8a879a0 100644
--- a/third_party/blink/renderer/platform/wtf/vector.h
+++ b/third_party/blink/renderer/platform/wtf/vector.h
@@ -950,11 +950,10 @@
return unsafe_reinterpret_cast_ptr<const T*>(inline_buffer_);
}
- template <bool = Allocator::kIsGarbageCollected>
- void InitInlinedBuffer() {}
- template <>
- void InitInlinedBuffer<true>() {
- memset(&inline_buffer_, 0, kInlineBufferSize);
+ void InitInlinedBuffer() {
+ if (Allocator::kIsGarbageCollected) {
+ memset(&inline_buffer_, 0, kInlineBufferSize);
+ }
}
alignas(T) char inline_buffer_[kInlineBufferSize];