Skip to content

Commit

Permalink
3.05.07 release
Browse files Browse the repository at this point in the history
  • Loading branch information
rparolin committed Jun 21, 2017
1 parent e5b0dc0 commit d321f48
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 15 deletions.
7 changes: 7 additions & 0 deletions doc/EASTL.natvis
Original file line number Diff line number Diff line change
Expand Up @@ -424,4 +424,11 @@
</Expand>
</Type>

<Type Name="eastl::ring_buffer&lt;*,*,*&gt;">
<DisplayString>{c}</DisplayString>
<Expand>
<ExpandedItem>c</ExpandedItem>
</Expand>
</Type>

</AutoVisualizer>
8 changes: 6 additions & 2 deletions include/EASTL/any.h
Original file line number Diff line number Diff line change
Expand Up @@ -526,10 +526,14 @@ namespace eastl
return *p;
}

// NOTE(rparolin): The runtime type check was commented out because in DLL builds the templated function pointer
// value will be different -- completely breaking the validation mechanism. Due to the fact that eastl::any uses
// type erasure we can't refesh (on copy/move) the cached function pointer to the internal handler function because
// we don't statically know the type.
template <class ValueType>
inline const ValueType* any_cast(const any* pAny) EA_NOEXCEPT
{
return (pAny && pAny->m_handler == &any::storage_handler<decay_t<ValueType>>::handler_func
return (pAny && pAny->m_handler //== &any::storage_handler<decay_t<ValueType>>::handler_func
#if EASTL_RTTI_ENABLED
&& pAny->type() == typeid(typename remove_reference<ValueType>::type)
#endif
Expand All @@ -541,7 +545,7 @@ namespace eastl
template <class ValueType>
inline ValueType* any_cast(any* pAny) EA_NOEXCEPT
{
return (pAny && pAny->m_handler == &any::storage_handler<decay_t<ValueType>>::handler_func
return (pAny && pAny->m_handler //== &any::storage_handler<decay_t<ValueType>>::handler_func
#if EASTL_RTTI_ENABLED
&& pAny->type() == typeid(typename remove_reference<ValueType>::type)
#endif
Expand Down
16 changes: 13 additions & 3 deletions include/EASTL/fixed_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ namespace eastl

mpBegin = mpEnd = (value_type*)&mBuffer.buffer[0];
internalCapacityPtr() = mpBegin + nodeCount;
base_type::template DoAssign<iterator, true>(x.begin(), x.end(), false_type());
base_type::template DoAssign<move_iterator<iterator>, true>(make_move_iterator(x.begin()), make_move_iterator(x.end()), false_type());
}


Expand Down Expand Up @@ -359,12 +359,22 @@ namespace eastl
inline typename fixed_vector<T, nodeCount, bEnableOverflow, OverflowAllocator>::this_type&
fixed_vector<T, nodeCount, bEnableOverflow, OverflowAllocator>::operator=(this_type&& x)
{
// Since we are a fixed_vector, we can't swap pointers. We can possibly so something like fixed_swap or
// Since we are a fixed_vector, we can't swap pointers. We can possibly do something like fixed_swap or
// we can just do an assignment from x. If we want to do the former then we need to have some complicated
// code to deal with overflow or no overflow, and whether the memory is in the fixed-size buffer or in
// the overflow allocator. 90% of the time the memory should be in the fixed buffer, in which case
// a simple assignment is no worse than the fancy pathway.
return operator=(x);
if (this != &x)
{
clear();

#if EASTL_ALLOCATOR_COPY_ENABLED
get_allocator() = x.get_allocator(); // The primary effect of this is to copy the overflow allocator.
#endif

base_type::template DoAssign<move_iterator<iterator>, true>(make_move_iterator(x.begin()), make_move_iterator(x.end()), false_type()); // Shorter route.
}
return *this;
}
#endif

Expand Down
8 changes: 4 additions & 4 deletions include/EASTL/internal/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@
///////////////////////////////////////////////////////////////////////////////

#ifndef EASTL_VERSION
#define EASTL_VERSION "3.05.06"
#define EASTL_VERSION_N 30506
#define EASTL_VERSION "3.05.07"
#define EASTL_VERSION_N 30507
#endif


Expand Down Expand Up @@ -634,8 +634,8 @@ namespace eastl
#include <signal.h>
#include <unistd.h>
#define EASTL_DEBUG_BREAK() kill( getpid(), SIGINT )
#elif defined(EA_PROCESSOR_ARM64) && defined(__GNUC__)
#define EASTL_DEBUG_BREAK() asm("brk 10")
#elif defined(EA_PROCESSOR_ARM64) && defined(__GNUC__)
#define EASTL_DEBUG_BREAK() asm("brk 10")
#elif defined(EA_PROCESSOR_ARM) && defined(__GNUC__)
#define EASTL_DEBUG_BREAK() asm("BKPT 10") // The 10 is arbitrary. It's just a unique id.
#elif defined(EA_PROCESSOR_ARM) && defined(__ARMCC_VERSION)
Expand Down
6 changes: 3 additions & 3 deletions include/EASTL/internal/hashtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ namespace eastl
// convenience macros to increase the readability of the code paths that must SFINAE on if the 'hash_node'
// contains the cached hashed value or not.
#define ENABLE_IF_HAS_HASHCODE(T, RT) typename eastl::enable_if<Internal::has_hashcode_member<T>::value, RT>::type*
#define ENABLE_IF_HASHCODE_U32(T, RT) typename eastl::enable_if<eastl::is_same<T, uint32_t>::value, RT>::type
#define ENABLE_IF_HASHCODE_EASTLSIZET(T, RT) typename eastl::enable_if<eastl::is_convertible<T, eastl_size_t>::value, RT>::type
#define ENABLE_IF_TRUETYPE(T) typename eastl::enable_if<T::value>::type*
#define DISABLE_IF_TRUETYPE(T) typename eastl::enable_if<!T::value>::type*

Expand Down Expand Up @@ -1134,7 +1134,7 @@ namespace eastl
/// It returns an iterator to the first element that matches the given hash. However, there may be multiple elements that match the given hash.

template<typename HashCodeT>
ENABLE_IF_HASHCODE_U32(HashCodeT, iterator) find_by_hash(HashCodeT c)
ENABLE_IF_HASHCODE_EASTLSIZET(HashCodeT, iterator) find_by_hash(HashCodeT c)
{
EASTL_CT_ASSERT_MSG(bCacheHashCode,
"find_by_hash(hash_code_t c) is designed to avoid recomputing hashes, "
Expand All @@ -1150,7 +1150,7 @@ namespace eastl
}

template<typename HashCodeT>
ENABLE_IF_HASHCODE_U32(HashCodeT, const_iterator) find_by_hash(HashCodeT c) const
ENABLE_IF_HASHCODE_EASTLSIZET(HashCodeT, const_iterator) find_by_hash(HashCodeT c) const
{
EASTL_CT_ASSERT_MSG(bCacheHashCode,
"find_by_hash(hash_code_t c) is designed to avoid recomputing hashes, "
Expand Down
2 changes: 1 addition & 1 deletion test/packages/EABase/include/Common/EABase/eahave.h
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@
#if defined(EA_PLATFORM_MICROSOFT) && !defined(EA_PLATFORM_MINGW)
#define EA_HAVE_ISNAN(x) _isnan(x) /* declared in <math.h> */
#define EA_HAVE_ISINF(x) !_finite(x)
#elif defined(EA_PLATFORM_APPLE) || defined(EA_PLATFORM_LINUX)
#elif defined(EA_PLATFORM_APPLE)
#define EA_HAVE_ISNAN(x) std::isnan(x) /* declared in <cmath> */
#define EA_HAVE_ISINF(x) std::isinf(x)
#elif defined(EA_PLATFORM_ANDROID)
Expand Down
4 changes: 2 additions & 2 deletions test/packages/EATest/include/EATest/EATest.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
#define EATEST_DEBUG_BREAK() {__asm__("int $3\n" : : ); }
#elif defined(EA_PROCESSOR_ARM) && defined(__APPLE__)
#define EATEST_DEBUG_BREAK() asm("trap") // Apparently __builtin_trap() doesn't let you continue execution, so we don't use it.
#elif defined(EA_PROCESSOR_ARM64) && defined(__GNUC__)
#define EATEST_DEBUG_BREAK() asm("brk 10")
#elif defined(EA_PROCESSOR_ARM64) && defined(__GNUC__)
#define EATEST_DEBUG_BREAK() asm("brk 10")
#elif defined(EA_PROCESSOR_ARM) && defined(__GNUC__)
#define EATEST_DEBUG_BREAK() asm("BKPT 10") // The 10 is arbitrary. It's just a unique id.
#elif defined(EA_PROCESSOR_ARM) && defined(__ARMCC_VERSION)
Expand Down
29 changes: 29 additions & 0 deletions test/source/TestFixedVector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "EASTLTest.h"
#include <EASTL/fixed_vector.h>
#include <EASTL/unique_ptr.h>
#include <EAStdC/EAMemory.h>
#include <new>

Expand Down Expand Up @@ -498,6 +499,34 @@ int TestFixedVector()

} // "Crash here."

#if EASTL_MOVE_SEMANTICS_ENABLED
{
const int FV_SIZE = 100;
fixed_vector<unique_ptr<unsigned int>, FV_SIZE> fvmv1; // to move via move assignment operator
fixed_vector<unique_ptr<unsigned int>, FV_SIZE> fvmv2; // to move via move copy constructor

for (unsigned int i = 0; i < FV_SIZE; ++i) // populate fvmv1
fvmv1.push_back(make_unique<unsigned int>(i));

fvmv2 = eastl::move(fvmv1); // Test move assignment operator

for (unsigned int i = 0; i < FV_SIZE; ++i)
{
EATEST_VERIFY(!fvmv1[i]);
EATEST_VERIFY(*fvmv2[i] == i);
}
EATEST_VERIFY(fvmv2.validate());

fixed_vector<unique_ptr<unsigned int>, FV_SIZE> fv = eastl::move(fvmv2); // Test move copy constructor
for (unsigned int i = 0; i < FV_SIZE; ++i)
{
EATEST_VERIFY(!fvmv2[i]);
EATEST_VERIFY(*fv[i] == i);
}
EATEST_VERIFY(fv.validate());
}
#endif

return nErrorCount;
}

Expand Down

0 comments on commit d321f48

Please sign in to comment.