Skip to content

Commit 05127ae

Browse files
committed
3.16.05
1 parent b254863 commit 05127ae

File tree

14 files changed

+222
-78
lines changed

14 files changed

+222
-78
lines changed

doc/EASTL.natvis

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,23 @@
7878
</Expand>
7979
</Type>
8080

81+
82+
<Type Name="eastl::basic_string&lt;wchar_t,*&gt;">
83+
<DisplayString Condition="!!(mPair.mFirst.sso.mRemainingSizeField.mnRemainingSize &amp; kSSOMask)">{mPair.mFirst.heap.mpBegin,su}</DisplayString>
84+
<DisplayString Condition="!(mPair.mFirst.sso.mRemainingSizeField.mnRemainingSize &amp; kSSOMask)">{mPair.mFirst.sso.mData,su}</DisplayString>
85+
<Expand>
86+
<Item Name="[length]" Condition="!!(mPair.mFirst.sso.mRemainingSizeField.mnRemainingSize &amp; kSSOMask)">mPair.mFirst.heap.mnSize</Item>
87+
<Item Name="[capacity]" Condition="!!(mPair.mFirst.sso.mRemainingSizeField.mnRemainingSize &amp; kSSOMask)">(mPair.mFirst.heap.mnCapacity &amp; ~kHeapMask)</Item>
88+
<Item Name="[value]" Condition="!!(mPair.mFirst.sso.mRemainingSizeField.mnRemainingSize &amp; kSSOMask)">mPair.mFirst.heap.mpBegin,su</Item>
89+
90+
<Item Name="[length]" Condition="!(mPair.mFirst.sso.mRemainingSizeField.mnRemainingSize &amp; kSSOMask)">mPair.mFirst.sso.mRemainingSizeField.mnRemainingSize</Item>
91+
<Item Name="[capacity]" Condition="!(mPair.mFirst.sso.mRemainingSizeField.mnRemainingSize &amp; kSSOMask)">SSOLayout::SSO_CAPACITY</Item>
92+
<Item Name="[value]" Condition="!(mPair.mFirst.sso.mRemainingSizeField.mnRemainingSize &amp; kSSOMask)">mPair.mFirst.sso.mData,su</Item>
93+
94+
<Item Name="[uses heap]">!!(mPair.mFirst.sso.mRemainingSizeField.mnRemainingSize &amp; kSSOMask)</Item>
95+
</Expand>
96+
</Type>
97+
8198
<Type Name="eastl::pair&lt;*&gt;">
8299
<DisplayString>({first}, {second})</DisplayString>
83100
<Expand>

include/EASTL/allocator_malloc.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,20 @@
3232
#include <stdlib.h> // memalign, posix_memalign.
3333
#define EASTL_ALIGNED_MALLOC_AVAILABLE 1
3434

35-
#if defined(__clang__)
36-
#if __has_include(<malloc/malloc.h>)
35+
#if EA_HAS_INCLUDE_AVAILABLE
36+
#if EA_HAS_INCLUDE(<malloc/malloc.h>)
3737
#include <malloc/malloc.h>
38-
#elif __has_include(<malloc.h>)
38+
#elif EA_HAS_INCLUDE(<malloc.h>)
3939
#include <malloc.h>
4040
#endif
4141
#elif defined(EA_PLATFORM_BSD)
4242
#include <malloc/malloc.h>
43+
#elif defined(EA_COMPILER_CLANG)
44+
#if __has_include(<malloc/malloc.h>)
45+
#include <malloc/malloc.h>
46+
#elif __has_include(<malloc.h>)
47+
#include <malloc.h>
48+
#endif
4349
#else
4450
#include <malloc.h>
4551
#endif

include/EASTL/finally.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
#endif
3333

3434
#include <EASTL/internal/config.h>
35+
#include <EASTL/internal/move_help.h>
36+
#include <EASTL/type_traits.h>
3537

3638
namespace eastl
3739
{

include/EASTL/internal/config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@
8989
///////////////////////////////////////////////////////////////////////////////
9090

9191
#ifndef EASTL_VERSION
92-
#define EASTL_VERSION "3.16.01"
93-
#define EASTL_VERSION_N 31601
92+
#define EASTL_VERSION "3.16.05"
93+
#define EASTL_VERSION_N 31605
9494
#endif
9595

9696

include/EASTL/memory.h

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ namespace eastl
169169
/// operator * or ->. autoConstruct is convenient but it causes * and -> to be slightly slower
170170
/// and may result in construction at an inconvenient time.
171171
///
172+
/// The autoDestruct template parameter controls whether the object, if constructed, is automatically
173+
/// destructed when ~late_constructed() is called or must be manually destructed via a call to
174+
/// destruct().
175+
///
172176
/// While construction can be automatic or manual, automatic destruction support is always present.
173177
/// Thus you aren't required in any case to manually call destruct. However, you may safely manually
174178
/// destruct the object at any time before the late_constructed destructor is executed.
@@ -199,11 +203,11 @@ namespace eastl
199203
/// // You may want to call destruct here, but aren't required to do so unless the Widget type requires it.
200204
/// }
201205
///
202-
template <typename T, bool autoConstruct = true>
206+
template <typename T, bool autoConstruct = true, bool autoDestruct = true>
203207
class late_constructed
204208
{
205209
public:
206-
using this_type = late_constructed<T, autoConstruct>;
210+
using this_type = late_constructed<T, autoConstruct, autoDestruct>;
207211
using value_type = T;
208212
using storage_type = eastl::aligned_storage_t<sizeof(value_type), eastl::alignment_of_v<value_type>>;
209213

@@ -212,16 +216,16 @@ namespace eastl
212216

213217
~late_constructed()
214218
{
215-
if(mpValue)
219+
if (autoDestruct && mpValue)
216220
(*mpValue).~value_type();
217-
}
221+
}
218222

219223
template <typename... Args>
220224
void construct(Args&&... args)
221225
{
222226
if(!mpValue)
223-
mpValue = new(&mStorage) value_type(eastl::forward<Args>(args)...);
224-
}
227+
mpValue = new (&mStorage) value_type(eastl::forward<Args>(args)...);
228+
}
225229

226230
bool is_constructed() const EA_NOEXCEPT
227231
{ return mpValue != nullptr; }
@@ -288,11 +292,11 @@ namespace eastl
288292

289293

290294
// Specialization that doesn't auto-construct on demand.
291-
template <typename T>
292-
class late_constructed<T, false> : public late_constructed<T, true>
295+
template <typename T, bool autoDestruct>
296+
class late_constructed<T, false, autoDestruct> : public late_constructed<T, true, autoDestruct>
293297
{
294298
public:
295-
typedef late_constructed<T, true> base_type;
299+
typedef late_constructed<T, true, autoDestruct> base_type;
296300

297301
typename base_type::value_type& operator*() EA_NOEXCEPT
298302
{ EASTL_ASSERT(base_type::mpValue); return *base_type::mpValue; }

include/EASTL/string.h

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3900,12 +3900,12 @@ namespace eastl
39003900
typedef basic_string<char> string;
39013901
typedef basic_string<wchar_t> wstring;
39023902

3903-
/// string8 / string16 / string32
3904-
typedef basic_string<char8_t> string8;
3903+
/// custom string8 / string16 / string32
3904+
typedef basic_string<char> string8;
39053905
typedef basic_string<char16_t> string16;
39063906
typedef basic_string<char32_t> string32;
39073907

3908-
// C++11 string types
3908+
/// ISO mandated string types
39093909
typedef basic_string<char8_t> u8string; // Actually not a C++11 type, but added for consistency.
39103910
typedef basic_string<char16_t> u16string;
39113911
typedef basic_string<char32_t> u32string;
@@ -3934,20 +3934,22 @@ namespace eastl
39343934
}
39353935
};
39363936

3937-
#if defined(EA_CHAR8_UNIQUE) && EA_CHAR8_UNIQUE
3938-
template <>
3939-
struct hash<string8>
3940-
{
3941-
size_t operator()(const string8& x) const
3942-
{
3943-
const char8_t* p = (const char8_t*)x.c_str();
3944-
unsigned int c, result = 2166136261U;
3945-
while((c = *p++) != 0)
3946-
result = (result * 16777619) ^ c;
3947-
return (size_t)result;
3948-
}
3949-
};
3950-
#endif
3937+
// NOTE(rparolin): no longer required.
3938+
//
3939+
// #if defined(EA_CHAR8_UNIQUE) && EA_CHAR8_UNIQUE
3940+
// template <>
3941+
// struct hash<string8>
3942+
// {
3943+
// size_t operator()(const string8& x) const
3944+
// {
3945+
// const char8_t* p = (const char8_t*)x.c_str();
3946+
// unsigned int c, result = 2166136261U;
3947+
// while((c = *p++) != 0)
3948+
// result = (result * 16777619) ^ c;
3949+
// return (size_t)result;
3950+
// }
3951+
// };
3952+
// #endif
39513953

39523954
template <>
39533955
struct hash<string16>

include/EASTL/vector_multimap.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,9 @@ namespace eastl
304304
inline vector_multimap<K, T, C, A, RAC>::vector_multimap()
305305
: base_type(), mValueCompare(C())
306306
{
307+
#if EASTL_NAME_ENABLED
307308
get_allocator().set_name(EASTL_VECTOR_MULTIMAP_DEFAULT_NAME);
309+
#endif
308310
}
309311

310312

test/packages/EATest

Submodule EATest updated 1 file

0 commit comments

Comments
 (0)