private:
typedef std::integral_constant<bool,
- std::has_trivial_copy_constructor<T>::value &&
+ boost::has_trivial_copy_constructor<T>::value &&
sizeof(T) <= 16 // don't force large structures to be passed by value
> should_pass_by_value;
typedef typename std::conditional<
void M_destroy(T* p) noexcept {
if (usingStdAllocator::value) {
- if (!std::has_trivial_destructor<T>::value) p->~T();
+ if (!boost::has_trivial_destructor<T>::value) p->~T();
} else {
folly::fbv_allocator_traits<Allocator>::destroy(impl_, p);
}
// optimized
static void S_destroy_range(T* first, T* last) noexcept {
- if (!std::has_trivial_destructor<T>::value) {
+ if (!boost::has_trivial_destructor<T>::value) {
// EXPERIMENTAL DATA on fbvector<vector<int>> (where each vector<int> has
// size 0).
// The unrolled version seems to work faster for small to medium sized
if (impl_.b_)
M_deallocate(impl_.b_, impl_.z_ - impl_.b_);
impl_.z_ = newB + newCap;
- impl_.e_ += newB - impl_.b_; // speed hax
+ impl_.e_ = newB + (impl_.e_ - impl_.b_);
impl_.b_ = newB;
}
if (impl_.b_)
M_deallocate(impl_.b_, impl_.z_ - impl_.b_);
impl_.z_ = newB + newCap;
- impl_.e_ += newB - impl_.b_; // speed hax
+ impl_.e_ = newB + (impl_.e_ - impl_.b_);
impl_.b_ = newB;
}
}
size_type lower = folly::goodMallocSize(sizeof(T) + size() * sizeof(T));
size_type upper = byte_sz;
size_type extra = upper - lower;
- assert(extra >= 0);
void* p = impl_.b_;
size_t actual;
} // namespace folly
#endif // FOLLY_FBVECTOR_H
-