Skip to content
Snippets Groups Projects
Commit 22d5c879 authored by Guilherme Amadio's avatar Guilherme Amadio Committed by Danilo Piparo
Browse files

Revert "[RVec] Further refine SBO code to improve performance"

This reverts commit 9e38c890.
parent 6f865948
Branches
Tags
No related merge requests found
...@@ -318,7 +318,7 @@ public: ...@@ -318,7 +318,7 @@ public:
using const_iterator = typename Impl_t::const_iterator; using const_iterator = typename Impl_t::const_iterator;
using reverse_iterator = typename Impl_t::reverse_iterator; using reverse_iterator = typename Impl_t::reverse_iterator;
using const_reverse_iterator = typename Impl_t::const_reverse_iterator; using const_reverse_iterator = typename Impl_t::const_reverse_iterator;
static constexpr std::size_t fgBufferSize = std::is_arithmetic<T>::value && !fgIsVecBool ? 16 : 0; static constexpr std::size_t fgBufferSize = std::is_arithmetic<T>::value && !fgIsVecBool ? 32 : 0;
private: private:
// We need this class for the case where fgBufferSize is 0, otherwise array<NonCopiable, 0> // We need this class for the case where fgBufferSize is 0, otherwise array<NonCopiable, 0>
...@@ -346,9 +346,17 @@ private: ...@@ -346,9 +346,17 @@ private:
/// The default storage std::vector, initialised with the allocator /// The default storage std::vector, initialised with the allocator
Impl_t fData{fAlloc}; Impl_t fData{fAlloc};
bool CanUseBuffer(std::size_t s)
{
const auto thisBufSize = ::ROOT::Detail::VecOps::GetBufferSize(fAlloc);
return thisBufSize && s <= thisBufSize;
}
bool CanUseBuffer(const RVec &v) bool CanUseBuffer(const RVec &v)
{ {
const auto thisBufSize = ::ROOT::Detail::VecOps::GetBufferSize(fAlloc); const auto thisBufSize = ::ROOT::Detail::VecOps::GetBufferSize(fAlloc);
const auto otherBufSize = ::ROOT::Detail::VecOps::GetBufferSize(v.fAlloc);
if (thisBufSize == 0 && otherBufSize == 0)
return false;
return thisBufSize && v.size() <= thisBufSize; return thisBufSize && v.size() <= thisBufSize;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment