Skip to content

Commit

Permalink
3.01.01 release
Browse files Browse the repository at this point in the history
  • Loading branch information
rparolin committed May 25, 2016
1 parent 895afcd commit 7ef3a6a
Show file tree
Hide file tree
Showing 19 changed files with 380 additions and 135 deletions.
4 changes: 2 additions & 2 deletions include/EASTL/allocator_malloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ namespace eastl
void* allocate(size_t n, size_t alignment, size_t alignmentOffset, int /*flags*/ = 0)
{
#if EASTL_ALIGNED_MALLOC_AVAILABLE
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.
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.
return memalign(alignment, n); // memalign is more consistently available than posix_memalign.
#else
if((alignment <= EASTL_SYSTEM_ALLOCATOR_MIN_ALIGNMENT) && ((alignmentOffset % alignment) != 0))
if((alignment <= EASTL_SYSTEM_ALLOCATOR_MIN_ALIGNMENT) && ((alignmentOffset % alignment) == 0))
return malloc(n);
#endif
return NULL;
Expand Down
70 changes: 51 additions & 19 deletions include/EASTL/fixed_hash_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
#include <EASTL/hash_map.h>
#include <EASTL/internal/fixed_pool.h>

EA_DISABLE_VC_WARNING(4127) // Conditional expression is constant

#if defined(EA_PRAGMA_ONCE_SUPPORTED)
#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.
#endif



namespace eastl
{
/// EASTL_FIXED_HASH_MAP_DEFAULT_NAME
Expand Down Expand Up @@ -255,7 +256,9 @@ namespace eastl
Predicate(), fixed_allocator_type(NULL, mBucketBuffer, overflowAllocator))
{
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

if(!bEnableOverflow)
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

#if EASTL_NAME_ENABLED
mAllocator.set_name(EASTL_FIXED_HASH_MAP_DEFAULT_NAME);
Expand All @@ -273,7 +276,9 @@ namespace eastl
predicate, fixed_allocator_type(NULL, mBucketBuffer))
{
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

if(!bEnableOverflow)
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

#if EASTL_NAME_ENABLED
mAllocator.set_name(EASTL_FIXED_HASH_MAP_DEFAULT_NAME);
Expand All @@ -292,7 +297,9 @@ namespace eastl
predicate, fixed_allocator_type(NULL, mBucketBuffer, overflowAllocator))
{
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

if(!bEnableOverflow)
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

#if EASTL_NAME_ENABLED
mAllocator.set_name(EASTL_FIXED_HASH_MAP_DEFAULT_NAME);
Expand All @@ -312,7 +319,9 @@ namespace eastl
predicate, fixed_allocator_type(NULL, mBucketBuffer))
{
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

if(!bEnableOverflow)
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

#if EASTL_NAME_ENABLED
mAllocator.set_name(EASTL_FIXED_HASH_MAP_DEFAULT_NAME);
Expand All @@ -336,7 +345,9 @@ namespace eastl
#endif

EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

if(!bEnableOverflow)
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

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

EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

if(!bEnableOverflow)
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

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

EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

if(!bEnableOverflow)
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

mAllocator.reset(mNodeBuffer);
base_type::insert(x.begin(), x.end());
Expand All @@ -394,7 +409,9 @@ namespace eastl
Predicate(), fixed_allocator_type(NULL, mBucketBuffer, overflowAllocator))
{
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

if(!bEnableOverflow)
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

#if EASTL_NAME_ENABLED
mAllocator.set_name(EASTL_FIXED_HASH_MAP_DEFAULT_NAME);
Expand Down Expand Up @@ -522,7 +539,9 @@ namespace eastl
Predicate(), fixed_allocator_type(NULL, mBucketBuffer, overflowAllocator))
{
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

if(!bEnableOverflow)
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

#if EASTL_NAME_ENABLED
mAllocator.set_name(EASTL_FIXED_HASH_MULTIMAP_DEFAULT_NAME);
Expand All @@ -540,7 +559,9 @@ namespace eastl
predicate, fixed_allocator_type(NULL, mBucketBuffer))
{
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

if(!bEnableOverflow)
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

#if EASTL_NAME_ENABLED
mAllocator.set_name(EASTL_FIXED_HASH_MULTIMAP_DEFAULT_NAME);
Expand All @@ -559,7 +580,9 @@ namespace eastl
predicate, fixed_allocator_type(NULL, mBucketBuffer, overflowAllocator))
{
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

if(!bEnableOverflow)
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

#if EASTL_NAME_ENABLED
mAllocator.set_name(EASTL_FIXED_HASH_MULTIMAP_DEFAULT_NAME);
Expand All @@ -579,7 +602,9 @@ namespace eastl
predicate, fixed_allocator_type(NULL, mBucketBuffer))
{
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

if(!bEnableOverflow)
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

#if EASTL_NAME_ENABLED
mAllocator.set_name(EASTL_FIXED_HASH_MULTIMAP_DEFAULT_NAME);
Expand All @@ -603,7 +628,9 @@ namespace eastl
#endif

EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

if(!bEnableOverflow)
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

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

EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

if(!bEnableOverflow)
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

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

EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

if(!bEnableOverflow)
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

mAllocator.reset(mNodeBuffer);
base_type::insert(x.begin(), x.end());
Expand All @@ -661,7 +692,9 @@ namespace eastl
Predicate(), fixed_allocator_type(NULL, mBucketBuffer, overflowAllocator))
{
EASTL_CT_ASSERT((nodeCount >= 1) && (bucketCount >= 2));
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

if(!bEnableOverflow)
base_type::set_max_load_factor(10000.f); // Set it so that we will never resize.

#if EASTL_NAME_ENABLED
mAllocator.set_name(EASTL_FIXED_HASH_MULTIMAP_DEFAULT_NAME);
Expand Down Expand Up @@ -777,8 +810,7 @@ namespace eastl

} // namespace eastl



EA_RESTORE_VC_WARNING()

#endif // Header include guard

Expand Down
Loading

0 comments on commit 7ef3a6a

Please sign in to comment.