Skip to content

Commit 7ef3a6a

Browse files
committed
3.01.01 release
1 parent 895afcd commit 7ef3a6a

19 files changed

+380
-135
lines changed

include/EASTL/allocator_malloc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ namespace eastl
8888
void* allocate(size_t n, size_t alignment, size_t alignmentOffset, int /*flags*/ = 0)
8989
{
9090
#if EASTL_ALIGNED_MALLOC_AVAILABLE
91-
if((alignmentOffset % alignment) != 0) // We check for (offset % alignmnent == 0) instead of (offset == 0) because any block which is aligned on e.g. 64 also is aligned at an offset of 64 by definition.
91+
if((alignmentOffset % alignment) == 0) // We check for (offset % alignmnent == 0) instead of (offset == 0) because any block which is aligned on e.g. 64 also is aligned at an offset of 64 by definition.
9292
return memalign(alignment, n); // memalign is more consistently available than posix_memalign.
9393
#else
94-
if((alignment <= EASTL_SYSTEM_ALLOCATOR_MIN_ALIGNMENT) && ((alignmentOffset % alignment) != 0))
94+
if((alignment <= EASTL_SYSTEM_ALLOCATOR_MIN_ALIGNMENT) && ((alignmentOffset % alignment) == 0))
9595
return malloc(n);
9696
#endif
9797
return NULL;

include/EASTL/fixed_hash_map.h

Lines changed: 51 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
#include <EASTL/hash_map.h>
1616
#include <EASTL/internal/fixed_pool.h>
1717

18+
EA_DISABLE_VC_WARNING(4127) // Conditional expression is constant
19+
1820
#if defined(EA_PRAGMA_ONCE_SUPPORTED)
1921
#pragma once // Some compilers (e.g. VC++) benefit significantly from using this. We've measured 3-4% build speed improvements in apps as a result.
2022
#endif
2123

2224

23-
2425
namespace eastl
2526
{
2627
/// EASTL_FIXED_HASH_MAP_DEFAULT_NAME
@@ -255,7 +256,9 @@ namespace eastl
255256
Predicate(), fixed_allocator_type(NULL, mBucketBuffer, overflowAllocator))
256257
{
257258
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
258-
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
259+
260+
if(!bEnableOverflow)
261+
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
259262

260263
#if EASTL_NAME_ENABLED
261264
mAllocator.set_name(EASTL_FIXED_HASH_MAP_DEFAULT_NAME);
@@ -273,7 +276,9 @@ namespace eastl
273276
predicate, fixed_allocator_type(NULL, mBucketBuffer))
274277
{
275278
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
276-
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
279+
280+
if(!bEnableOverflow)
281+
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
277282

278283
#if EASTL_NAME_ENABLED
279284
mAllocator.set_name(EASTL_FIXED_HASH_MAP_DEFAULT_NAME);
@@ -292,7 +297,9 @@ namespace eastl
292297
predicate, fixed_allocator_type(NULL, mBucketBuffer, overflowAllocator))
293298
{
294299
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
295-
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
300+
301+
if(!bEnableOverflow)
302+
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
296303

297304
#if EASTL_NAME_ENABLED
298305
mAllocator.set_name(EASTL_FIXED_HASH_MAP_DEFAULT_NAME);
@@ -312,7 +319,9 @@ namespace eastl
312319
predicate, fixed_allocator_type(NULL, mBucketBuffer))
313320
{
314321
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
315-
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
322+
323+
if(!bEnableOverflow)
324+
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
316325

317326
#if EASTL_NAME_ENABLED
318327
mAllocator.set_name(EASTL_FIXED_HASH_MAP_DEFAULT_NAME);
@@ -336,7 +345,9 @@ namespace eastl
336345
#endif
337346

338347
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
339-
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
348+
349+
if(!bEnableOverflow)
350+
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
340351

341352
mAllocator.reset(mNodeBuffer);
342353
base_type::insert(x.begin(), x.end());
@@ -358,7 +369,9 @@ namespace eastl
358369
#endif
359370

360371
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
361-
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
372+
373+
if(!bEnableOverflow)
374+
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
362375

363376
mAllocator.reset(mNodeBuffer);
364377
base_type::insert(x.begin(), x.end());
@@ -379,7 +392,9 @@ namespace eastl
379392
#endif
380393

381394
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
382-
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
395+
396+
if(!bEnableOverflow)
397+
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
383398

384399
mAllocator.reset(mNodeBuffer);
385400
base_type::insert(x.begin(), x.end());
@@ -394,7 +409,9 @@ namespace eastl
394409
Predicate(), fixed_allocator_type(NULL, mBucketBuffer, overflowAllocator))
395410
{
396411
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
397-
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
412+
413+
if(!bEnableOverflow)
414+
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
398415

399416
#if EASTL_NAME_ENABLED
400417
mAllocator.set_name(EASTL_FIXED_HASH_MAP_DEFAULT_NAME);
@@ -522,7 +539,9 @@ namespace eastl
522539
Predicate(), fixed_allocator_type(NULL, mBucketBuffer, overflowAllocator))
523540
{
524541
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
525-
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
542+
543+
if(!bEnableOverflow)
544+
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
526545

527546
#if EASTL_NAME_ENABLED
528547
mAllocator.set_name(EASTL_FIXED_HASH_MULTIMAP_DEFAULT_NAME);
@@ -540,7 +559,9 @@ namespace eastl
540559
predicate, fixed_allocator_type(NULL, mBucketBuffer))
541560
{
542561
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
543-
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
562+
563+
if(!bEnableOverflow)
564+
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
544565

545566
#if EASTL_NAME_ENABLED
546567
mAllocator.set_name(EASTL_FIXED_HASH_MULTIMAP_DEFAULT_NAME);
@@ -559,7 +580,9 @@ namespace eastl
559580
predicate, fixed_allocator_type(NULL, mBucketBuffer, overflowAllocator))
560581
{
561582
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
562-
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
583+
584+
if(!bEnableOverflow)
585+
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
563586

564587
#if EASTL_NAME_ENABLED
565588
mAllocator.set_name(EASTL_FIXED_HASH_MULTIMAP_DEFAULT_NAME);
@@ -579,7 +602,9 @@ namespace eastl
579602
predicate, fixed_allocator_type(NULL, mBucketBuffer))
580603
{
581604
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
582-
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
605+
606+
if(!bEnableOverflow)
607+
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
583608

584609
#if EASTL_NAME_ENABLED
585610
mAllocator.set_name(EASTL_FIXED_HASH_MULTIMAP_DEFAULT_NAME);
@@ -603,7 +628,9 @@ namespace eastl
603628
#endif
604629

605630
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
606-
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
631+
632+
if(!bEnableOverflow)
633+
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
607634

608635
mAllocator.reset(mNodeBuffer);
609636
base_type::insert(x.begin(), x.end());
@@ -625,7 +652,9 @@ namespace eastl
625652
#endif
626653

627654
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
628-
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
655+
656+
if(!bEnableOverflow)
657+
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
629658

630659
mAllocator.reset(mNodeBuffer);
631660
base_type::insert(x.begin(), x.end());
@@ -646,7 +675,9 @@ namespace eastl
646675
#endif
647676

648677
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
649-
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
678+
679+
if(!bEnableOverflow)
680+
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
650681

651682
mAllocator.reset(mNodeBuffer);
652683
base_type::insert(x.begin(), x.end());
@@ -661,7 +692,9 @@ namespace eastl
661692
Predicate(), fixed_allocator_type(NULL, mBucketBuffer, overflowAllocator))
662693
{
663694
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
664-
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
695+
696+
if(!bEnableOverflow)
697+
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.
665698

666699
#if EASTL_NAME_ENABLED
667700
mAllocator.set_name(EASTL_FIXED_HASH_MULTIMAP_DEFAULT_NAME);
@@ -777,8 +810,7 @@ namespace eastl
777810

778811
} // namespace eastl
779812

780-
781-
813+
EA_RESTORE_VC_WARNING()
782814

783815
#endif // Header include guard
784816

0 commit comments

Comments
 (0)