Skip to content

Commit

Permalink
3.13.00 release
Browse files Browse the repository at this point in the history
  • Loading branch information
rparolin committed Jan 23, 2019
1 parent d581ecd commit 87967e4
Show file tree
Hide file tree
Showing 11 changed files with 128 additions and 80 deletions.
11 changes: 1 addition & 10 deletions include/EASTL/algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -2015,7 +2015,7 @@ namespace eastl
inline bool equal(const signed char* first1, const signed char* last1, const signed char* first2)
{ return (memcmp(first1, first2, (size_t)((uintptr_t)last1 - (uintptr_t)first1)) == 0); }
#ifndef EA_WCHAR_T_NON_NATIVE // EABase defines this. If you are getting a compiler error here, then somebody has taken away EABase or broken it.
#ifndef EA_WCHAR_T_NON_NATIVE
inline bool equal(const wchar_t* first1, const wchar_t* last1, const wchar_t* first2)
{ return (memcmp(first1, first2, (size_t)((uintptr_t)last1 - (uintptr_t)first1)) == 0); }
#endif
Expand All @@ -2037,15 +2037,6 @@ namespace eastl
inline bool equal(const uint64_t* first1, const uint64_t* last1, const uint64_t* first2)
{ return (memcmp(first1, first2, (size_t)((uintptr_t)last1 - (uintptr_t)first1)) == 0); }
inline bool equal(const float* first1, const float* last1, const float* first2)
{ return (memcmp(first1, first2, (size_t)((uintptr_t)last1 - (uintptr_t)first1)) == 0); }
inline bool equal(const double* first1, const double* last1, const double* first2)
{ return (memcmp(first1, first2, (size_t)((uintptr_t)last1 - (uintptr_t)first1)) == 0); }
inline bool equal(const long double* first1, const long double* last1, const long double* first2)
{ return (memcmp(first1, first2, (size_t)((uintptr_t)last1 - (uintptr_t)first1)) == 0); }
*/


Expand Down
21 changes: 10 additions & 11 deletions include/EASTL/deque.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,10 @@ namespace eastl
DequeIterator(const iterator& x, Increment);
DequeIterator(const iterator& x, Decrement);

this_type copy(const iterator& first, const iterator& last, true_type); // true means that value_type has the type_trait is_move_assignable,
this_type copy(const iterator& first, const iterator& last, true_type); // true means that value_type has the type_trait has_trivial_relocate,
this_type copy(const iterator& first, const iterator& last, false_type); // false means it does not.

void copy_backward(const iterator& first, const iterator& last, true_type); // true means that value_type has the type_trait is_move_assignable,
void copy_backward(const iterator& first, const iterator& last, true_type); // true means that value_type has the type_trait has_trivial_relocate,
void copy_backward(const iterator& first, const iterator& last, false_type); // false means it does not.

void SetSubarray(T** pCurrentArrayPtr);
Expand Down Expand Up @@ -1049,7 +1049,6 @@ namespace eastl
// Currently we only do memcpy if the entire operation occurs within a single subarray.
if((first.mpBegin == last.mpBegin) && (first.mpBegin == mpBegin)) // If all operations are within the same subarray, implement the operation as a memmove.
{
// The following is equivalent to: eastl::copy(first.mpCurrent, last.mpCurrent, mpCurrent);
memmove(mpCurrent, first.mpCurrent, (size_t)((uintptr_t)last.mpCurrent - (uintptr_t)first.mpCurrent));
return *this + (last.mpCurrent - first.mpCurrent);
}
Expand All @@ -1061,7 +1060,7 @@ namespace eastl
typename DequeIterator<T, Pointer, Reference, kDequeSubarraySize>::this_type
DequeIterator<T, Pointer, Reference, kDequeSubarraySize>::copy(const iterator& first, const iterator& last, false_type)
{
return eastl::copy(first, last, *this);
return eastl::copy(eastl::make_move_iterator(first), eastl::make_move_iterator(last), eastl::make_move_iterator(*this)).base();
}


Expand All @@ -1080,7 +1079,7 @@ namespace eastl
template <typename T, typename Pointer, typename Reference, unsigned kDequeSubarraySize>
void DequeIterator<T, Pointer, Reference, kDequeSubarraySize>::copy_backward(const iterator& first, const iterator& last, false_type)
{
eastl::copy_backward(first, last, *this);
eastl::copy_backward(eastl::make_move_iterator(first), eastl::make_move_iterator(last), eastl::make_move_iterator(*this)).base();
}


Expand Down Expand Up @@ -1788,7 +1787,7 @@ namespace eastl
iterator oldBegin (mItBegin, typename iterator::Increment());
const iterator oldBeginPlus1(oldBegin, typename iterator::Increment());

oldBegin.copy(oldBeginPlus1, newPosition, eastl::is_move_assignable<value_type>());
oldBegin.copy(oldBeginPlus1, newPosition, eastl::has_trivial_relocate<value_type>());
}
else
{
Expand All @@ -1799,7 +1798,7 @@ namespace eastl
iterator oldBack (mItEnd, typename iterator::Decrement());
const iterator oldBackMinus1(oldBack, typename iterator::Decrement());

oldBack.copy_backward(itPosition, oldBackMinus1, eastl::is_move_assignable<value_type>());
oldBack.copy_backward(itPosition, oldBackMinus1, eastl::has_trivial_relocate<value_type>());
}

*itPosition = eastl::move(valueSaved);
Expand Down Expand Up @@ -1936,12 +1935,12 @@ namespace eastl

if(i < (difference_type)(size() / 2)) // Should we move the front entries forward or the back entries backward? We divide the range in half.
{
itNext.copy_backward(mItBegin, itPosition, eastl::is_move_assignable<value_type>());
itNext.copy_backward(mItBegin, itPosition, eastl::has_trivial_relocate<value_type>());
pop_front();
}
else
{
itPosition.copy(itNext, mItEnd, eastl::is_move_assignable<value_type>());
itPosition.copy(itNext, mItEnd, eastl::has_trivial_relocate<value_type>());
pop_back();
}

Expand Down Expand Up @@ -1973,7 +1972,7 @@ namespace eastl
const iterator itNewBegin(mItBegin + n);
value_type** const pPtrArrayBegin = mItBegin.mpCurrentArrayPtr;

itLast.copy_backward(mItBegin, itFirst, eastl::is_move_assignable<value_type>());
itLast.copy_backward(mItBegin, itFirst, eastl::has_trivial_relocate<value_type>());

for(; mItBegin != itNewBegin; ++mItBegin) // Question: If value_type is a POD type, will the compiler generate this loop at all?
mItBegin.mpCurrent->~value_type(); // If so, then we need to make a specialization for destructing PODs.
Expand All @@ -1987,7 +1986,7 @@ namespace eastl
iterator itNewEnd(mItEnd - n);
value_type** const pPtrArrayEnd = itNewEnd.mpCurrentArrayPtr + 1;

itFirst.copy(itLast, mItEnd, eastl::is_move_assignable<value_type>());
itFirst.copy(itLast, mItEnd, eastl::has_trivial_relocate<value_type>());

for(iterator itTemp(itNewEnd); itTemp != mItEnd; ++itTemp)
itTemp.mpCurrent->~value_type();
Expand Down
44 changes: 1 addition & 43 deletions include/EASTL/internal/allocator_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ namespace eastl
};


#if EASTL_VARIADIC_TEMPLATES_ENABLED
// has_construct
template <class Alloc, class T, class... Args>
decltype(eastl::declval<Alloc>().construct(eastl::declval<T*>(), eastl::declval<Args>()...), eastl::true_type())
Expand All @@ -220,24 +219,6 @@ namespace eastl
eastl::true_type>::value>
{
};
#else
// has_construct (single argument case)
template <class Alloc, class T, class Arg0>
decltype(eastl::declval<Alloc>().construct(eastl::declval<T*>(), eastl::declval<Arg0>()), eastl::true_type())
has_construct_test(Alloc&& a, T* p, Arg0&& args);

template <class Alloc, class Pointer, class Arg0>
eastl::false_type has_construct_test(const Alloc& a, Pointer&& p, Arg0&& args);

template <class Alloc, class Pointer, class Arg0>
struct has_construct
: public eastl::integral_constant< bool,
eastl::is_same<decltype(has_construct_test(eastl::declval<Alloc>(), eastl::declval<Pointer>(),
eastl::declval<Arg0>())),
eastl::true_type>::value>
{
};
#endif


// has_destroy
Expand Down Expand Up @@ -333,7 +314,6 @@ namespace eastl

static void deallocate(allocator_type& a, pointer p, size_type n) EA_NOEXCEPT { a.deallocate(p, n); }

#ifndef EA_COMPILER_NO_VARIADIC_TEMPLATES
template <class T, class... Args>
static void internal_construct(eastl::true_type, allocator_type& a, T* p, Args&&... args)
{
Expand All @@ -351,34 +331,12 @@ namespace eastl
{
internal_construct(Internal::has_construct<allocator_type, T*, Args...>(), a, p, eastl::forward<Args>(args)...);
}
#else // EA_COMPILER_NO_VARIADIC_TEMPLATES
template <class T>
static void construct(allocator_type& a, T* p)
{
::new ((void*)p) T();
}
template <class T, class A0>
static void construct(allocator_type& a, T* p, const A0& a0)
{
::new ((void*)p) T(a0);
}
template <class T, class A0, class A1>
static void construct(allocator_type& a, T* p, const A0& a0, const A1& a1)
{
::new ((void*)p) T(a0, a1);
}
template <class T, class A0, class A1, class A2>
static void construct(allocator_type& a, T* p, const A0& a0, const A1& a1, const A2& a2)
{
::new ((void*)p) T(a0, a1, a2);
}
#endif // EA_COMPILER_NO_VARIADIC_TEMPLATES

template <class T>
static void internal_destroy(eastl::true_type, allocator_type& a, T* p) { a.destroy(p); }

template <class T>
static void internal_destroy(eastl::false_type, allocator_type&, T* p) { p->~T(); }
static void internal_destroy(eastl::false_type, allocator_type&, T* p) { EA_UNUSED(p); p->~T(); }

template <class T>
static void destroy(allocator_type& a, T* p)
Expand Down
4 changes: 2 additions & 2 deletions include/EASTL/internal/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
///////////////////////////////////////////////////////////////////////////////

#ifndef EASTL_VERSION
#define EASTL_VERSION "3.12.08"
#define EASTL_VERSION_N 31208
#define EASTL_VERSION "3.13.00"
#define EASTL_VERSION_N 31300
#endif


Expand Down
8 changes: 4 additions & 4 deletions include/EASTL/internal/hashtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -1273,10 +1273,10 @@ namespace eastl

// We keep DoInsertKey overload without third parameter, for compatibility with older revisions of EASTL (3.12.07 and earlier)
// It used to call get_hash_code as a first call inside the DoInsertKey.
eastl::pair<iterator, bool> DoInsertKey(true_type, const key_type& key){return DoInsertKey(true_type(), key, get_hash_code(key));}
iterator DoInsertKey(false_type, const key_type& key){return DoInsertKey(false_type(), key, get_hash_code(key));}
eastl::pair<iterator, bool> DoInsertKey(true_type, key_type&& key){return DoInsertKey(true_type(), eastl::move(key), get_hash_code(key));}
iterator DoInsertKey(false_type, key_type&& key){return DoInsertKey(false_type(), eastl::move(key), get_hash_code(key));}
eastl::pair<iterator, bool> DoInsertKey(true_type, const key_type& key) { return DoInsertKey(true_type(), key, get_hash_code(key)); }
iterator DoInsertKey(false_type, const key_type& key) { return DoInsertKey(false_type(), key, get_hash_code(key)); }
eastl::pair<iterator, bool> DoInsertKey(true_type, key_type&& key) { return DoInsertKey(true_type(), eastl::move(key), get_hash_code(key)); }
iterator DoInsertKey(false_type, key_type&& key) { return DoInsertKey(false_type(), eastl::move(key), get_hash_code(key)); }

void DoRehash(size_type nBucketCount);
node_type* DoFindNode(node_type* pNode, const key_type& k, hash_code_t c) const;
Expand Down
44 changes: 43 additions & 1 deletion include/EASTL/internal/type_compound.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ namespace eastl
template <typename T>
struct is_member_function_pointer : public integral_constant<bool, is_mem_fun_pointer_value<T>::value>{};

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template<typename T>
EA_CONSTEXPR bool is_member_function_pointer_v = is_member_function_pointer<T>::value;
#endif


///////////////////////////////////////////////////////////////////////
// is_member_pointer
Expand All @@ -196,6 +201,10 @@ namespace eastl
struct is_member_pointer<U T::*>
: public eastl::true_type{};

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template<typename T>
EA_CONSTEXPR bool is_member_pointer_v = is_member_pointer<T>::value;
#endif


///////////////////////////////////////////////////////////////////////
Expand All @@ -213,6 +222,10 @@ namespace eastl
eastl::is_member_pointer<T>::value &&
!eastl::is_member_function_pointer<T>::value
> {};
#if EASTL_VARIABLE_TEMPLATES_ENABLED
template<typename T>
EA_CONSTEXPR bool is_member_object_pointer_v = is_member_object_pointer<T>::value;
#endif


///////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -402,6 +415,10 @@ namespace eastl
struct is_class : public false_type{};
#endif

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template<typename T>
EA_CONSTEXPR bool is_class_v = is_class<T>::value;
#endif


///////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -445,7 +462,7 @@ namespace eastl
template <> struct is_enum<void const volatile> : public false_type {};
#endif

#if !defined(EA_COMPILER_NO_TEMPLATE_ALIASES)
#if EASTL_VARIABLE_TEMPLATES_ENABLED
template<typename T>
EA_CONSTEXPR bool is_enum_v = is_enum<T>::value;
#endif
Expand Down Expand Up @@ -519,6 +536,11 @@ namespace eastl
struct is_polymorphic : public integral_constant<bool, is_polymorphic_value<T>::value>{};
#endif

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template<typename T>
EA_CONSTEXPR bool is_polymorphic_v = is_polymorphic<T>::value;
#endif




Expand All @@ -543,6 +565,11 @@ namespace eastl
!is_reference<T>::value && !is_void<T>::value && !is_function<T>::value
>{};

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template<typename T>
EA_CONSTEXPR bool is_object_v = is_object<T>::value;
#endif


///////////////////////////////////////////////////////////////////////
// is_scalar
Expand All @@ -569,6 +596,11 @@ namespace eastl
template <typename T> struct is_scalar<T* volatile> : public true_type {};
template <typename T> struct is_scalar<T* const volatile> : public true_type {};

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template<typename T>
EA_CONSTEXPR bool is_scalar_v = is_scalar<T>::value;
#endif


///////////////////////////////////////////////////////////////////////
// is_compound
Expand All @@ -590,6 +622,11 @@ namespace eastl
template <typename T>
struct is_compound : public integral_constant<bool, !is_fundamental<T>::value>{};

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template<typename T>
EA_CONSTEXPR bool is_compound_v = is_compound<T>::value;
#endif



///////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -691,6 +728,11 @@ namespace eastl
template <typename T>
struct is_final : public false_type {};
#endif

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template<typename T>
EA_CONSTEXPR bool is_final_v = is_final<T>::value;
#endif
} // namespace eastl


Expand Down
5 changes: 5 additions & 0 deletions include/EASTL/internal/type_pod.h
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,11 @@ namespace eastl
template <> struct is_abstract<const volatile T> : public eastl::integral_constant<bool, isAbstract> { }; \
}

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template <class T>
EA_CONSTEXPR bool is_abstract_v = is_abstract<T>::value;
#endif


///////////////////////////////////////////////////////////////////////
// is_trivially_copyable
Expand Down
6 changes: 4 additions & 2 deletions include/EASTL/unique_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,11 @@ namespace eastl
/// ptr.reset(NULL); // deletes int(4)
void reset(pointer pValue = pointer()) EA_NOEXCEPT
{
if(pValue != mPair.first())
if (pValue != mPair.first())
{
get_deleter()(mPair.first());
if (mPair.first())
get_deleter()(mPair.first());

mPair.first() = pValue;
}
}
Expand Down
7 changes: 7 additions & 0 deletions test/packages/EABase/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
build:
script:
- nant -masterconfigfile:f:\dev.xml -buildroot:f:\ci-builds -D:config=pc64-vc-dev-debug-opt test-build

test:
script:
- nant -masterconfigfile:f:\dev.xml -buildroot:f:\ci-builds -D:config=pc64-vc-dev-debug-opt test-run-fast
Loading

0 comments on commit 87967e4

Please sign in to comment.