Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EASTL version 3.21.23 #536

Merged
merged 6 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ option(EASTL_BUILD_BENCHMARK "Enable generation of build files for benchmark" OF
option(EASTL_BUILD_TESTS "Enable generation of build files for tests" OFF)
option(EASTL_STD_ITERATOR_CATEGORY_ENABLED "Enable compatibility with std:: iterator categories" OFF)


option(EASTL_DISABLE_APRIL_2024_DEPRECATIONS "Enable use of API marked for removal in April 2024." OFF)
option(EASTL_DISABLE_SEPT_2024_DEPRECATIONS "Enable use of API marked for removal in September 2024." OFF)
option(EASTL_DISABLE_APRIL_2025_DEPRECATIONS "Enable use of API marked for removal in April 2025." OFF)

#-------------------------------------------------------------------------------------------
# Compiler Flags
#-------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -68,14 +73,28 @@ target_include_directories(EASTL PUBLIC include)
FetchContent_Declare(
EABase
GIT_REPOSITORY https://github.com/electronicarts/EABase.git
GIT_TAG 521cb053d9320636f53226ffc616216cf532f0ef
GIT_TAG 123363eb82e132c0181ac53e43226d8ee76dea12
GIT_SUBMODULES "" # This should be temporary until we update the cyclic submodule dependencies in EABase.
)

FetchContent_MakeAvailable(EABase)

target_link_libraries(EASTL EABase)

#-------------------------------------------------------------------------------------------
# Deprecations
#-------------------------------------------------------------------------------------------
if(EASTL_DISABLE_APRIL_2024_DEPRECATIONS)
target_compile_definitions(EASTL PUBLIC EA_DEPRECATIONS_FOR_2024_APRIL=EA_DISABLED)
endif()
if(EASTL_DISABLE_SEPT_2024_DEPRECATIONS)
target_compile_definitions(EASTL PUBLIC EA_DEPRECATIONS_FOR_2024_SEPT=EA_DISABLED)
endif()
if(EASTL_DISABLE_APRIL_2025_DEPRECATIONS)
target_compile_definitions(EASTL PUBLIC EA_DEPRECATIONS_FOR_2025_APRIL=EA_DISABLED)
endif()


#-------------------------------------------------------------------------------------------
# Installation
#-------------------------------------------------------------------------------------------
Expand Down
56 changes: 28 additions & 28 deletions benchmark/source/BenchmarkAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ namespace
std::string::const_iterator it = std::find_end(sTest.begin(), sTest.end(), pSearchStringBegin, pSearchStringEnd);
stopwatch.Stop();
if(it != sTest.end())
sprintf(Benchmark::gScratchBuffer, "%c", *it);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%c", *it);
}

void TestFindEndEa(EA::StdC::Stopwatch& stopwatch, const eastl::string& sTest, const char* pSearchStringBegin, const char* pSearchStringEnd)
Expand All @@ -88,7 +88,7 @@ namespace
eastl::string::const_iterator it = eastl::find_end(sTest.begin(), sTest.end(), pSearchStringBegin, pSearchStringEnd);
stopwatch.Stop();
if(it != sTest.end())
sprintf(Benchmark::gScratchBuffer, "%c", *it);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%c", *it);
}


Expand All @@ -99,7 +99,7 @@ namespace
std::string::const_iterator it = std::search(sTest.begin(), sTest.end(), pSearchStringBegin, pSearchStringEnd);
stopwatch.Stop();
if(it != sTest.end())
sprintf(Benchmark::gScratchBuffer, "%c", *it);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%c", *it);
}

void TestSearchEa(EA::StdC::Stopwatch& stopwatch, const eastl::string& sTest, const char* pSearchStringBegin, const char* pSearchStringEnd)
Expand All @@ -108,7 +108,7 @@ namespace
eastl::string::const_iterator it = eastl::search(sTest.begin(), sTest.end(), pSearchStringBegin, pSearchStringEnd);
stopwatch.Stop();
if(it != sTest.end())
sprintf(Benchmark::gScratchBuffer, "%c", *it);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%c", *it);
}


Expand All @@ -119,7 +119,7 @@ namespace
std::string::const_iterator it = std::search_n(sTest.begin(), sTest.end(), n, c);
stopwatch.Stop();
if(it != sTest.end())
sprintf(Benchmark::gScratchBuffer, "%c", *it);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%c", *it);
}

void TestSearchNEa(EA::StdC::Stopwatch& stopwatch, const eastl::string& sTest, int n, char c)
Expand All @@ -128,7 +128,7 @@ namespace
eastl::string::const_iterator it = eastl::search_n(sTest.begin(), sTest.end(), n, c);
stopwatch.Stop();
if(it != sTest.end())
sprintf(Benchmark::gScratchBuffer, "%c", *it);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%c", *it);
}


Expand Down Expand Up @@ -159,7 +159,7 @@ namespace
stopwatch.Restart();
const typename Container::const_iterator it = std::min_element(c.begin(), c.end());
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%p", &it);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%p", &it);
}

template <typename Container>
Expand All @@ -168,7 +168,7 @@ namespace
stopwatch.Restart();
const typename Container::const_iterator it = eastl::min_element(c.begin(), c.end());
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%p", &it);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%p", &it);
}


Expand All @@ -179,7 +179,7 @@ namespace
stopwatch.Restart();
const typename Container::difference_type n = std::count(c.begin(), c.end(), (typename Container::value_type)999999);
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%d", (int)n);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%d", (int)n);
}

template <typename Container>
Expand All @@ -188,7 +188,7 @@ namespace
stopwatch.Restart();
const typename Container::difference_type n = eastl::count(c.begin(), c.end(), (typename Container::value_type)999999);
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%d", (int)n);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%d", (int)n);
}


Expand All @@ -199,7 +199,7 @@ namespace
stopwatch.Restart();
const typename Container::const_iterator it = std::adjacent_find(c.begin(), c.end());
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%p", &it);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%p", &it);
}

template <typename Container>
Expand All @@ -208,7 +208,7 @@ namespace
stopwatch.Restart();
const typename Container::const_iterator it = eastl::adjacent_find(c.begin(), c.end());
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%p", &it);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%p", &it);
}


Expand Down Expand Up @@ -301,7 +301,7 @@ namespace
stopwatch.Restart();
const bool bResult = std::lexicographical_compare(first1, last1, first2, last2);
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%d", bResult ? (int)1 : (int)0);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%d", bResult ? (int)1 : (int)0);
}

template <typename Iterator1, typename Iterator2>
Expand All @@ -310,7 +310,7 @@ namespace
stopwatch.Restart();
const bool bResult = eastl::lexicographical_compare(first1, last1, first2, last2);
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%d", bResult ? (int)1 : (int)0);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%d", bResult ? (int)1 : (int)0);
}


Expand All @@ -321,7 +321,7 @@ namespace
stopwatch.Restart();
std::copy(first, last, result);
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%d", (int)*first);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%d", (int)*first);
}

template <typename Iterator, typename OutputIterator>
Expand All @@ -330,7 +330,7 @@ namespace
stopwatch.Restart();
eastl::copy(first, last, result);
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%d", (int)*first);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%d", (int)*first);
}


Expand All @@ -341,7 +341,7 @@ namespace
stopwatch.Restart();
std::copy_backward(first, last, result);
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%d", (int)*first);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%d", (int)*first);
}

template <typename Iterator, typename OutputIterator>
Expand All @@ -350,7 +350,7 @@ namespace
stopwatch.Restart();
eastl::copy_backward(first, last, result);
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%d", (int)*first);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%d", (int)*first);
}


Expand All @@ -361,7 +361,7 @@ namespace
stopwatch.Restart();
std::fill(first, last, v);
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%p", &*first);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%p", &*first);
}

template <typename Iterator, typename Value>
Expand All @@ -370,7 +370,7 @@ namespace
stopwatch.Restart();
eastl::fill(first, last, v);
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%p", &*first);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%p", &*first);
}


Expand All @@ -381,7 +381,7 @@ namespace
stopwatch.Restart();
std::fill_n(first, n, v);
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%p", &*first);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%p", &*first);
}

template <typename Iterator, typename Value>
Expand All @@ -390,7 +390,7 @@ namespace
stopwatch.Restart();
eastl::fill_n(first, n, v);
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%p", &*first);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%p", &*first);
}


Expand All @@ -401,7 +401,7 @@ namespace
stopwatch.Restart();
std::reverse(first, last);
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%p", &*first);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%p", &*first);
}

template <typename Iterator>
Expand All @@ -410,7 +410,7 @@ namespace
stopwatch.Restart();
eastl::reverse(first, last);
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%p", &*first);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%p", &*first);
}


Expand All @@ -421,7 +421,7 @@ namespace
stopwatch.Restart();
std::rotate(first, middle, last); // C++11 specifies that rotate has a return value, but not all std implementations return it.
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%p", &*first);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%p", &*first);
}

template <typename Iterator>
Expand All @@ -430,7 +430,7 @@ namespace
stopwatch.Restart();
eastl::rotate(first, middle, last);
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%p", &*first);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%p", &*first);
}

template <typename Iterator>
Expand All @@ -439,7 +439,7 @@ namespace
stopwatch.Restart();
std::merge(firstIn1, lastIn1, firstIn2, lastIn2, out);
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%p", &*out);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%p", &*out);
}

template <typename Iterator>
Expand All @@ -448,7 +448,7 @@ namespace
stopwatch.Restart();
eastl::merge(firstIn1, lastIn1, firstIn2, lastIn2, out);
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%p", &*out);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%p", &*out);
}
} // namespace

Expand Down
19 changes: 5 additions & 14 deletions benchmark/source/BenchmarkDeque.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,6 @@ namespace
}


EASTL_DECLARE_POD(ValuePair)
EASTL_DECLARE_TRIVIAL_CONSTRUCTOR(ValuePair)
EASTL_DECLARE_TRIVIAL_COPY(ValuePair)
EASTL_DECLARE_TRIVIAL_ASSIGN(ValuePair)
EASTL_DECLARE_TRIVIAL_DESTRUCTOR(ValuePair)
EASTL_DECLARE_TRIVIAL_RELOCATE(ValuePair)



typedef std::deque<ValuePair> StdDeque;
typedef eastl::deque<ValuePair, EASTLAllocatorType, 128> EaDeque; // What value do we pick for the subarray size to make the comparison fair? Using the default isn't ideal because it results in this test measuring speed efficiency and ignoring memory efficiency.

Expand Down Expand Up @@ -106,7 +97,7 @@ namespace
for(typename Container::size_type j = 0, jEnd = c.size(); j < jEnd; j++)
temp += c[j].key;
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%u", (unsigned)(temp & 0xffffffff));
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%u", (unsigned)(temp & 0xffffffff));
}


Expand All @@ -119,7 +110,7 @@ namespace
++it;
stopwatch.Stop();
if(it != c.end())
sprintf(Benchmark::gScratchBuffer, "%u", (unsigned)(*it).key);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%u", (unsigned)(*it).key);

/* Alternative way to measure:
const eastl_size_t n = c.size();
Expand All @@ -128,7 +119,7 @@ namespace
++it;
stopwatch.Stop();
if(it != c.end())
sprintf(Benchmark::gScratchBuffer, "%u", (unsigned)(*it).key);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%u", (unsigned)(*it).key);
*/
}

Expand All @@ -143,7 +134,7 @@ namespace
typename Container::iterator it = eastl::find(c.begin(), c.end(), vp);
stopwatch.Stop();
if(it != c.end())
sprintf(Benchmark::gScratchBuffer, "%u", (unsigned)(*it).key);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%u", (unsigned)(*it).key);
}


Expand All @@ -156,7 +147,7 @@ namespace
stopwatch.Restart();
eastl::quick_sort(c.begin(), c.end(), vpCompare);
stopwatch.Stop();
sprintf(Benchmark::gScratchBuffer, "%u", (unsigned)c[0].key);
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%u", (unsigned)c[0].key);
}


Expand Down
Loading
Loading