mirror of
https://github.com/electronicarts/EASTL.git
synced 2026-01-18 17:21:19 +01:00
3.14.02 release
This commit is contained in:
@@ -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; }
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Submodule test/packages/EABase updated: 035b4d0664...d9b7808e21
Submodule test/packages/EAStdC updated: 7d25ccda99...2bad24e6bd
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user