Skip to content

Commit 7fadbf0

Browse files
authored
EASTL version 3.21.23 (#536)
* 3.21.23 * Add Cmake options to disable deprecations. * Bump EABase git-tag which includes necessary changes for EASTL. * Remove a bunch of unused parameters. * Disable deprecations when specializing templates and template variables using deprecated templates to fix gcc deprecation warnings. * Remove some tests which do not pass on GCC versions prior to 14.
1 parent c530255 commit 7fadbf0

File tree

108 files changed

+7719
-4080
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+7719
-4080
lines changed

CMakeLists.txt

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ option(EASTL_BUILD_BENCHMARK "Enable generation of build files for benchmark" OF
1212
option(EASTL_BUILD_TESTS "Enable generation of build files for tests" OFF)
1313
option(EASTL_STD_ITERATOR_CATEGORY_ENABLED "Enable compatibility with std:: iterator categories" OFF)
1414

15+
16+
option(EASTL_DISABLE_APRIL_2024_DEPRECATIONS "Enable use of API marked for removal in April 2024." OFF)
17+
option(EASTL_DISABLE_SEPT_2024_DEPRECATIONS "Enable use of API marked for removal in September 2024." OFF)
18+
option(EASTL_DISABLE_APRIL_2025_DEPRECATIONS "Enable use of API marked for removal in April 2025." OFF)
19+
1520
#-------------------------------------------------------------------------------------------
1621
# Compiler Flags
1722
#-------------------------------------------------------------------------------------------
@@ -68,14 +73,28 @@ target_include_directories(EASTL PUBLIC include)
6873
FetchContent_Declare(
6974
EABase
7075
GIT_REPOSITORY https://github.com/electronicarts/EABase.git
71-
GIT_TAG 521cb053d9320636f53226ffc616216cf532f0ef
76+
GIT_TAG 123363eb82e132c0181ac53e43226d8ee76dea12
7277
GIT_SUBMODULES "" # This should be temporary until we update the cyclic submodule dependencies in EABase.
7378
)
7479

7580
FetchContent_MakeAvailable(EABase)
7681

7782
target_link_libraries(EASTL EABase)
7883

84+
#-------------------------------------------------------------------------------------------
85+
# Deprecations
86+
#-------------------------------------------------------------------------------------------
87+
if(EASTL_DISABLE_APRIL_2024_DEPRECATIONS)
88+
target_compile_definitions(EASTL PUBLIC EA_DEPRECATIONS_FOR_2024_APRIL=EA_DISABLED)
89+
endif()
90+
if(EASTL_DISABLE_SEPT_2024_DEPRECATIONS)
91+
target_compile_definitions(EASTL PUBLIC EA_DEPRECATIONS_FOR_2024_SEPT=EA_DISABLED)
92+
endif()
93+
if(EASTL_DISABLE_APRIL_2025_DEPRECATIONS)
94+
target_compile_definitions(EASTL PUBLIC EA_DEPRECATIONS_FOR_2025_APRIL=EA_DISABLED)
95+
endif()
96+
97+
7998
#-------------------------------------------------------------------------------------------
8099
# Installation
81100
#-------------------------------------------------------------------------------------------

benchmark/source/BenchmarkAlgorithm.cpp

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ namespace
7979
std::string::const_iterator it = std::find_end(sTest.begin(), sTest.end(), pSearchStringBegin, pSearchStringEnd);
8080
stopwatch.Stop();
8181
if(it != sTest.end())
82-
sprintf(Benchmark::gScratchBuffer, "%c", *it);
82+
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%c", *it);
8383
}
8484

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

9494

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

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

114114

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

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

134134

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

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

174174

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

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

194194

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

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

214214

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

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

316316

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

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

336336

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

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

356356

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

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

376376

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

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

396396

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

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

416416

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

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

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

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

benchmark/source/BenchmarkDeque.cpp

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,6 @@ namespace
5656
}
5757

5858

59-
EASTL_DECLARE_POD(ValuePair)
60-
EASTL_DECLARE_TRIVIAL_CONSTRUCTOR(ValuePair)
61-
EASTL_DECLARE_TRIVIAL_COPY(ValuePair)
62-
EASTL_DECLARE_TRIVIAL_ASSIGN(ValuePair)
63-
EASTL_DECLARE_TRIVIAL_DESTRUCTOR(ValuePair)
64-
EASTL_DECLARE_TRIVIAL_RELOCATE(ValuePair)
65-
66-
67-
6859
typedef std::deque<ValuePair> StdDeque;
6960
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.
7061

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

112103

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

124115
/* Alternative way to measure:
125116
const eastl_size_t n = c.size();
@@ -128,7 +119,7 @@ namespace
128119
++it;
129120
stopwatch.Stop();
130121
if(it != c.end())
131-
sprintf(Benchmark::gScratchBuffer, "%u", (unsigned)(*it).key);
122+
EA::StdC::Snprintf(Benchmark::gScratchBuffer, Benchmark::kScratchBufferSize, "%u", (unsigned)(*it).key);
132123
*/
133124
}
134125

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

149140

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

162153

0 commit comments

Comments
 (0)