3.14.02 release

This commit is contained in:
Rob Parolin
2019-09-06 11:29:27 -07:00
parent 2feb6d54a8
commit 20284b7a5c
8 changed files with 72 additions and 70 deletions

View File

@@ -161,7 +161,11 @@ namespace EA
~CoreDeleterAdapter() EA_NOEXCEPT {}
template <typename T>
void operator()(T* p) { mpCoreAllocator->Free(p); }
void operator()(T* p)
{
p->~T();
mpCoreAllocator->Free(p);
}
CoreDeleterAdapter(const CoreDeleterAdapter& in) { mpCoreAllocator = in.mpCoreAllocator; }

View File

@@ -33,97 +33,97 @@ namespace eastl
///
/// These implement UTF8/UCS2/UCS4 encoding/decoding.
///
EASTL_API bool DecodePart(const char*& pSrc, const char* pSrcEnd, char*& pDest, char* pDestEnd);
EASTL_API bool DecodePart(const char*& pSrc, const char* pSrcEnd, char16_t*& pDest, char16_t* pDestEnd);
EASTL_API bool DecodePart(const char*& pSrc, const char* pSrcEnd, char32_t*& pDest, char32_t* pDestEnd);
EASTL_API bool DecodePart(const char*& pSrc, const char* pSrcEnd, char*& pDest, char* pDestEnd);
EASTL_API bool DecodePart(const char*& pSrc, const char* pSrcEnd, char16_t*& pDest, char16_t* pDestEnd);
EASTL_API bool DecodePart(const char*& pSrc, const char* pSrcEnd, char32_t*& pDest, char32_t* pDestEnd);
EASTL_API bool DecodePart(const char16_t*& pSrc, const char16_t* pSrcEnd, char*& pDest, char* pDestEnd);
EASTL_API bool DecodePart(const char16_t*& pSrc, const char16_t* pSrcEnd, char*& pDest, char* pDestEnd);
EASTL_API bool DecodePart(const char16_t*& pSrc, const char16_t* pSrcEnd, char16_t*& pDest, char16_t* pDestEnd);
EASTL_API bool DecodePart(const char16_t*& pSrc, const char16_t* pSrcEnd, char32_t*& pDest, char32_t* pDestEnd);
EASTL_API bool DecodePart(const char32_t*& pSrc, const char32_t* pSrcEnd, char*& pDest, char* pDestEnd);
EASTL_API bool DecodePart(const char32_t*& pSrc, const char32_t* pSrcEnd, char*& pDest, char* pDestEnd);
EASTL_API bool DecodePart(const char32_t*& pSrc, const char32_t* pSrcEnd, char16_t*& pDest, char16_t* pDestEnd);
EASTL_API bool DecodePart(const char32_t*& pSrc, const char32_t* pSrcEnd, char32_t*& pDest, char32_t* pDestEnd);
EASTL_API bool DecodePart(const int*& pSrc, const int* pSrcEnd, char*& pDest, char* pDestEnd);
EASTL_API bool DecodePart(const int*& pSrc, const int* pSrcEnd, char16_t*& pDest, char16_t* pDestEnd);
EASTL_API bool DecodePart(const int*& pSrc, const int* pSrcEnd, char32_t*& pDest, char32_t* pDestEnd);
EASTL_API bool DecodePart(const int*& pSrc, const int* pSrcEnd, char*& pDest, char* pDestEnd);
EASTL_API bool DecodePart(const int*& pSrc, const int* pSrcEnd, char16_t*& pDest, char16_t* pDestEnd);
EASTL_API bool DecodePart(const int*& pSrc, const int* pSrcEnd, char32_t*& pDest, char32_t* pDestEnd);
#if EA_CHAR8_UNIQUE
bool DecodePart(const char8_t*& pSrc, const char8_t* pSrcEnd, char*& pDest, char* pDestEnd);
bool DecodePart(const char8_t*& pSrc, const char8_t* pSrcEnd, char16_t*& pDest, char16_t* pDestEnd);
bool DecodePart(const char8_t*& pSrc, const char8_t* pSrcEnd, char32_t*& pDest, char32_t* pDestEnd);
bool DecodePart(const char8_t*& pSrc, const char8_t* pSrcEnd, char*& pDest, char* pDestEnd);
bool DecodePart(const char8_t*& pSrc, const char8_t* pSrcEnd, char16_t*& pDest, char16_t* pDestEnd);
bool DecodePart(const char8_t*& pSrc, const char8_t* pSrcEnd, char32_t*& pDest, char32_t* pDestEnd);
#endif
#if EA_WCHAR_UNIQUE
bool DecodePart(const wchar_t*& pSrc, const wchar_t* pSrcEnd, char*& pDest, char* pDestEnd);
bool DecodePart(const wchar_t*& pSrc, const wchar_t* pSrcEnd, char16_t*& pDest, char16_t* pDestEnd);
bool DecodePart(const wchar_t*& pSrc, const wchar_t* pSrcEnd, char32_t*& pDest, char32_t* pDestEnd);
bool DecodePart(const wchar_t*& pSrc, const wchar_t* pSrcEnd, char*& pDest, char* pDestEnd);
bool DecodePart(const wchar_t*& pSrc, const wchar_t* pSrcEnd, char16_t*& pDest, char16_t* pDestEnd);
bool DecodePart(const wchar_t*& pSrc, const wchar_t* pSrcEnd, char32_t*& pDest, char32_t* pDestEnd);
bool DecodePart(const char*& pSrc, const char* pSrcEnd, wchar_t*& pDest, wchar_t* pDestEnd);
bool DecodePart(const char16_t*& pSrc, const char16_t* pSrcEnd, wchar_t*& pDest, wchar_t* pDestEnd);
bool DecodePart(const char32_t*& pSrc, const char32_t* pSrcEnd, wchar_t*& pDest, wchar_t* pDestEnd);
bool DecodePart(const char*& pSrc, const char* pSrcEnd, wchar_t*& pDest, wchar_t* pDestEnd);
bool DecodePart(const char16_t*& pSrc, const char16_t* pSrcEnd, wchar_t*& pDest, wchar_t* pDestEnd);
bool DecodePart(const char32_t*& pSrc, const char32_t* pSrcEnd, wchar_t*& pDest, wchar_t* pDestEnd);
#endif
#if EA_CHAR8_UNIQUE && EA_WCHAR_UNIQUE
bool DecodePart(const char8_t*& pSrc, const char8_t* pSrcEnd, wchar_t*& pDest, wchar_t* pDestEnd);
bool DecodePart(const wchar_t*& pSrc, const wchar_t* pSrcEnd, char8_t*& pDest, char8_t* pDestEnd);
bool DecodePart(const char8_t*& pSrc, const char8_t* pSrcEnd, wchar_t*& pDest, wchar_t* pDestEnd);
bool DecodePart(const wchar_t*& pSrc, const wchar_t* pSrcEnd, char8_t*& pDest, char8_t* pDestEnd);
#endif
#if EA_WCHAR_UNIQUE
inline bool DecodePart(const wchar_t*& pSrc, const wchar_t* pSrcEnd, char*& pDest, char* pDestEnd)
{
#if (EA_WCHAR_SIZE == 2)
return DecodePart(reinterpret_cast<const char16_t*&>(pSrc), reinterpret_cast<const char16_t*>(pSrcEnd), pDest, pDestEnd);
#elif (EA_WCHAR_SIZE == 4)
return DecodePart(reinterpret_cast<const char32_t*&>(pSrc), reinterpret_cast<const char32_t*>(pSrcEnd), pDest, pDestEnd);
#endif
#if (EA_WCHAR_SIZE == 2)
return DecodePart(reinterpret_cast<const char16_t*&>(pSrc), reinterpret_cast<const char16_t*>(pSrcEnd), pDest, pDestEnd);
#elif (EA_WCHAR_SIZE == 4)
return DecodePart(reinterpret_cast<const char32_t*&>(pSrc), reinterpret_cast<const char32_t*>(pSrcEnd), pDest, pDestEnd);
#endif
}
inline bool DecodePart(const wchar_t*& pSrc, const wchar_t* pSrcEnd, char16_t*& pDest, char16_t* pDestEnd)
{
#if (EA_WCHAR_SIZE == 2)
return DecodePart(reinterpret_cast<const char16_t*&>(pSrc), reinterpret_cast<const char16_t*>(pSrcEnd), pDest, pDestEnd);
#elif (EA_WCHAR_SIZE == 4)
return DecodePart(reinterpret_cast<const char32_t*&>(pSrc), reinterpret_cast<const char32_t*>(pSrcEnd), pDest, pDestEnd);
#endif
#if (EA_WCHAR_SIZE == 2)
return DecodePart(reinterpret_cast<const char16_t*&>(pSrc), reinterpret_cast<const char16_t*>(pSrcEnd), pDest, pDestEnd);
#elif (EA_WCHAR_SIZE == 4)
return DecodePart(reinterpret_cast<const char32_t*&>(pSrc), reinterpret_cast<const char32_t*>(pSrcEnd), pDest, pDestEnd);
#endif
}
inline bool DecodePart(const wchar_t*& pSrc, const wchar_t* pSrcEnd, char32_t*& pDest, char32_t* pDestEnd)
{
#if (EA_WCHAR_SIZE == 2)
return DecodePart(reinterpret_cast<const char16_t*&>(pSrc), reinterpret_cast<const char16_t*>(pSrcEnd), pDest, pDestEnd);
#elif (EA_WCHAR_SIZE == 4)
return DecodePart(reinterpret_cast<const char32_t*&>(pSrc), reinterpret_cast<const char32_t*>(pSrcEnd), pDest, pDestEnd);
#endif
#if (EA_WCHAR_SIZE == 2)
return DecodePart(reinterpret_cast<const char16_t*&>(pSrc), reinterpret_cast<const char16_t*>(pSrcEnd), pDest, pDestEnd);
#elif (EA_WCHAR_SIZE == 4)
return DecodePart(reinterpret_cast<const char32_t*&>(pSrc), reinterpret_cast<const char32_t*>(pSrcEnd), pDest, pDestEnd);
#endif
}
inline bool DecodePart(const char*& pSrc, const char* pSrcEnd, wchar_t*& pDest, wchar_t* pDestEnd)
{
#if (EA_WCHAR_SIZE == 2)
return DecodePart(pSrc, pSrcEnd, reinterpret_cast<char16_t*&>(pDest), reinterpret_cast<char16_t*>(pDestEnd));
#elif (EA_WCHAR_SIZE == 4)
return DecodePart(pSrc, pSrcEnd, reinterpret_cast<char32_t*&>(pDest), reinterpret_cast<char32_t*>(pDestEnd));
#endif
#if (EA_WCHAR_SIZE == 2)
return DecodePart(pSrc, pSrcEnd, reinterpret_cast<char16_t*&>(pDest), reinterpret_cast<char16_t*>(pDestEnd));
#elif (EA_WCHAR_SIZE == 4)
return DecodePart(pSrc, pSrcEnd, reinterpret_cast<char32_t*&>(pDest), reinterpret_cast<char32_t*>(pDestEnd));
#endif
}
inline bool DecodePart(const char16_t*& pSrc, const char16_t* pSrcEnd, wchar_t*& pDest, wchar_t* pDestEnd)
{
#if (EA_WCHAR_SIZE == 2)
return DecodePart(pSrc, pSrcEnd, reinterpret_cast<char16_t*&>(pDest), reinterpret_cast<char16_t*>(pDestEnd));
#elif (EA_WCHAR_SIZE == 4)
return DecodePart(pSrc, pSrcEnd, reinterpret_cast<char32_t*&>(pDest), reinterpret_cast<char32_t*>(pDestEnd));
#endif
#if (EA_WCHAR_SIZE == 2)
return DecodePart(pSrc, pSrcEnd, reinterpret_cast<char16_t*&>(pDest), reinterpret_cast<char16_t*>(pDestEnd));
#elif (EA_WCHAR_SIZE == 4)
return DecodePart(pSrc, pSrcEnd, reinterpret_cast<char32_t*&>(pDest), reinterpret_cast<char32_t*>(pDestEnd));
#endif
}
inline bool DecodePart(const char32_t*& pSrc, const char32_t* pSrcEnd, wchar_t*& pDest, wchar_t* pDestEnd)
{
#if (EA_WCHAR_SIZE == 2)
return DecodePart(pSrc, pSrcEnd, reinterpret_cast<char16_t*&>(pDest), reinterpret_cast<char16_t*>(pDestEnd));
#elif (EA_WCHAR_SIZE == 4)
return DecodePart(pSrc, pSrcEnd, reinterpret_cast<char32_t*&>(pDest), reinterpret_cast<char32_t*>(pDestEnd));
#endif
#if (EA_WCHAR_SIZE == 2)
return DecodePart(pSrc, pSrcEnd, reinterpret_cast<char16_t*&>(pDest), reinterpret_cast<char16_t*>(pDestEnd));
#elif (EA_WCHAR_SIZE == 4)
return DecodePart(pSrc, pSrcEnd, reinterpret_cast<char32_t*&>(pDest), reinterpret_cast<char32_t*>(pDestEnd));
#endif
}
#endif
@@ -156,11 +156,11 @@ namespace eastl
inline bool DecodePart(const wchar_t*& pSrc, const wchar_t* pSrcEnd, char8_t*& pDest, char8_t* pDestEnd)
{
#if (EA_WCHAR_SIZE == 2)
return DecodePart(reinterpret_cast<const char16_t*&>(pSrc), reinterpret_cast<const char16_t*>(pSrcEnd), reinterpret_cast<char*&>(pDest), reinterpret_cast<char*>(pDestEnd));
#elif (EA_WCHAR_SIZE == 4)
return DecodePart(reinterpret_cast<const char32_t*&>(pSrc), reinterpret_cast<const char32_t*>(pSrcEnd), reinterpret_cast<char*&>(pDest), reinterpret_cast<char*>(pDestEnd));
#endif
#if (EA_WCHAR_SIZE == 2)
return DecodePart(reinterpret_cast<const char16_t*&>(pSrc), reinterpret_cast<const char16_t*>(pSrcEnd), reinterpret_cast<char*&>(pDest), reinterpret_cast<char*>(pDestEnd));
#elif (EA_WCHAR_SIZE == 4)
return DecodePart(reinterpret_cast<const char32_t*&>(pSrc), reinterpret_cast<const char32_t*>(pSrcEnd), reinterpret_cast<char*&>(pDest), reinterpret_cast<char*>(pDestEnd));
#endif
}
#endif

View File

@@ -89,8 +89,8 @@
///////////////////////////////////////////////////////////////////////////////
#ifndef EASTL_VERSION
#define EASTL_VERSION "3.14.01"
#define EASTL_VERSION_N 31401
#define EASTL_VERSION "3.14.02"
#define EASTL_VERSION_N 31402
#endif

View File

@@ -148,7 +148,7 @@ namespace eastl
EASTL_FAIL_MSG("string_view::copy -- out of range");
#endif
count = eastl::min(count, mnCount - pos);
count = eastl::min<size_type>(count, mnCount - pos);
auto* pResult = CharStringUninitializedCopy(mpBegin + pos, mpBegin + pos + count, pDestination);
// *pResult = 0; // don't write the null-terminator
return pResult - pDestination;
@@ -164,7 +164,7 @@ namespace eastl
EASTL_FAIL_MSG("string_view::substr -- out of range");
#endif
count = eastl::min(count, mnCount - pos);
count = eastl::min<size_type>(count, mnCount - pos);
return this_type(mpBegin + pos, count);
}

View File

@@ -21,7 +21,7 @@ namespace eastl
// Requires that pDest have a capacity of at least 6 chars.
// Sets pResult to '\1' in the case that c is an invalid UCS4 char.
bool UCS4ToUTF8(uint32_t c, char*& pResult)
inline bool UCS4ToUTF8(uint32_t c, char*& pResult)
{
if(c < 0x00000080)
*pResult++ = (char)(uint8_t)c;
@@ -73,7 +73,7 @@ namespace eastl
// Requires that pResult have a capacity of at least 3 chars.
// Sets pResult to '\1' in the case that c is an invalid UCS4 char.
bool UCS2ToUTF8(uint16_t c, char*& pResult)
inline bool UCS2ToUTF8(uint16_t c, char*& pResult)
{
return UCS4ToUTF8(c, pResult);
}
@@ -81,7 +81,7 @@ namespace eastl
// Sets result to 0xffff in the case that the input UTF8 sequence is bad.
// 32 bit 0xffffffff is an invalid UCS4 code point, so we can't use that as an error return value.
bool UTF8ToUCS4(const char*& p, const char* pEnd, uint32_t& result)
inline bool UTF8ToUCS4(const char*& p, const char* pEnd, uint32_t& result)
{
// This could likely be implemented in a faster-executing way that uses tables.
@@ -257,7 +257,7 @@ namespace eastl
// such codepoints to 0xffff. EASTL doesn't have a concept of setting or maintaining
// error state for string conversions, though it does have a policy of converting
// impossible values to something without generating invalid strings or throwing exceptions.
bool UTF8ToUCS2(const char*& p, const char* pEnd, uint16_t& result)
inline bool UTF8ToUCS2(const char*& p, const char* pEnd, uint16_t& result)
{
uint32_t u32;

View File

@@ -554,19 +554,17 @@ static int Test_unique_ptr()
using namespace EA::Allocator;
EASTLCoreAllocatorAdapter ta;
EASTLCoreAllocatorAdapter ta;
void* pMem = ta.allocate(sizeof(A));
EATEST_VERIFY(pMem != nullptr);
EATEST_VERIFY(gEASTLTest_AllocationCount > cacheAllocationCount);
{
A* pA = new (pMem) A();
eastl::shared_ptr<A> foo(pA, EASTLCoreDeleterAdapter()); // Not standards complaint code. Update EASTL implementation to provide the type of the deleter.
pA->~A();
}
EATEST_VERIFY(gEASTLTest_AllocationCount == cacheAllocationCount);
EATEST_VERIFY(A::mCount == 0);
EATEST_VERIFY(A::mCount == 0);
#endif
}