TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Electronic Arts Standard Template Library for C++ Open Sourced

207 pointsby hisingover 9 years ago

13 comments

pcwaltonover 9 years ago
We on the Rust team got to speak about the lessons learned from the EASTL with Paul Pedriana (the author of much of it) while designing the Rust standard library. It's a significant influence on the proposed allocators API currently in RFC. The EASTL is worth looking at for anyone interested in designing libraries that work well in low-memory environments. (Much of this library was written with devices like the Nintendo DS in mind, which had 4 MB--4 MB!--of RAM as I recall.)
评论 #11095901 未加载
albertzeyerover 9 years ago
STL is maybe a bit missleading because it doesn&#x27;t seem like it is a drop-in replacement for the STL.<p>However, this is certainly interesting because the emphasis on speed (and thus also on simplicity) is what I&#x27;m sometimes missing in the real STL or in Boost. That&#x27;s exactly what you need in a game but also in much other performance critical code.<p>As far as I remember, Chrome has used the STL earlier. But I looked now and I see this: <a href="https:&#x2F;&#x2F;chromium.googlesource.com&#x2F;chromium&#x2F;blink&#x2F;+&#x2F;master&#x2F;Source&#x2F;wtf&#x2F;" rel="nofollow">https:&#x2F;&#x2F;chromium.googlesource.com&#x2F;chromium&#x2F;blink&#x2F;+&#x2F;master&#x2F;So...</a><p>Gecko also seem to have a lot of custom stuff: <a href="https:&#x2F;&#x2F;github.com&#x2F;mozilla&#x2F;gecko-dev&#x2F;tree&#x2F;master&#x2F;xpcom&#x2F;string" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mozilla&#x2F;gecko-dev&#x2F;tree&#x2F;master&#x2F;xpcom&#x2F;strin...</a><p>Doom3 idLib: <a href="https:&#x2F;&#x2F;github.com&#x2F;id-Software&#x2F;DOOM-3-BFG&#x2F;tree&#x2F;master&#x2F;neo&#x2F;idlib" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;id-Software&#x2F;DOOM-3-BFG&#x2F;tree&#x2F;master&#x2F;neo&#x2F;id...</a><p>Unreal engine: <a href="https:&#x2F;&#x2F;answers.unrealengine.com&#x2F;questions&#x2F;2695&#x2F;rocket-and-the-stl.html" rel="nofollow">https:&#x2F;&#x2F;answers.unrealengine.com&#x2F;questions&#x2F;2695&#x2F;rocket-and-t...</a><p>You&#x27;ll find much more similar libs when you search in some of the big games.
评论 #11094804 未加载
评论 #11095383 未加载
评论 #11094774 未加载
评论 #11094961 未加载
United857over 9 years ago
Writeup on the key design and advantages of EASTL for their target platforms (game consoles): <a href="http:&#x2F;&#x2F;www.open-std.org&#x2F;jtc1&#x2F;sc22&#x2F;wg21&#x2F;docs&#x2F;papers&#x2F;2007&#x2F;n2271.html" rel="nofollow">http:&#x2F;&#x2F;www.open-std.org&#x2F;jtc1&#x2F;sc22&#x2F;wg21&#x2F;docs&#x2F;papers&#x2F;2007&#x2F;n227...</a>
uglycoyoteover 9 years ago
I have worked for game companies making large console games both with the STL and without. One thing I noticed about STL is that it really bloats the build times because the STL headers are so massive. I did some analysis of the preprocessor output one time and found that just including a couple of headers like vector.h and string.h would increase the size of the preprocessor output by 80000 to 100000 lines, even for a cop file that is otherwise trivially small. Typically almost every cpp file in the codebase would either directly use STL headers or bring them in as dependencies, and so in a codebase of a few thousand files you are talking about hundreds of millions of extra lines of code that the compiler has to churn through. This amounted to each cpp file talking several seconds to compile and the entire codebase taking most of an hour to rebuild. People would not have been able to survive that without using Incredibuild to farm off compilation to other machines. The company I currently work at does not use STL and so largely avoids this problem. I an curious to what extent EASTL has this problem or avoids it.
评论 #11097960 未加载
评论 #11097120 未加载
评论 #11098029 未加载
Negative1over 9 years ago
This was open sourced years ago on the EA open source page: <a href="http:&#x2F;&#x2F;j.mp&#x2F;1Kh4L2C" rel="nofollow">http:&#x2F;&#x2F;j.mp&#x2F;1Kh4L2C</a><p>It&#x27;s just on Github now.
评论 #11094753 未加载
评论 #11094751 未加载
评论 #11095537 未加载
评论 #11094722 未加载
captn3m0over 9 years ago
A quick reference guide in PDF is available at <a href="https:&#x2F;&#x2F;github.com&#x2F;electronicarts&#x2F;EASTL&#x2F;blob&#x2F;master&#x2F;doc&#x2F;EASTL%20Quick%20Reference.pdf" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;electronicarts&#x2F;EASTL&#x2F;blob&#x2F;master&#x2F;doc&#x2F;EAST...</a>. Lists all Algorithms, functions etc.
Animatsover 9 years ago
Cute. It&#x27;s fun to see game programmer code. This is really C with a little C++. Lots of pointer casts, comments like &quot;The user must provide ample buffer space, preferably 256 chars or more.&quot; There&#x27;s a lot of stuff in there to deal with Microsoft Visual C++&#x27;s interpretation of the language, which prior to 2010, was kind of off.<p>Why does &quot;swap&quot; use EASTL&#x2F;move_help.h? There are things that can go wrong with a move that can&#x27;t go wrong with a swap. Move is a swap with a constraint that the destination be empty.<p>(Doing things through swapping has its uses. It preserves single ownership, for example.)
评论 #11096366 未加载
评论 #11096993 未加载
评论 #11096395 未加载
评论 #11095692 未加载
评论 #11095264 未加载
mklover 9 years ago
Scott Wardle gave an interesting talk at CppCon 2015 which mentions EASTL a bit, with the reasons they use it (and other non-standard tools): “Memory and C++ debugging at Electronic Arts” <a href="https:&#x2F;&#x2F;youtu.be&#x2F;8KIvWJUYbDA" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;8KIvWJUYbDA</a>
评论 #11101298 未加载
delrothover 9 years ago
Note that EA had already released some of the code in 2010: <a href="https:&#x2F;&#x2F;github.com&#x2F;paulhodge&#x2F;EASTL" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;paulhodge&#x2F;EASTL</a>
评论 #11095435 未加载
jupp0rover 9 years ago
And I thought my workplace was the last shop in the world to still write new code in hungarian notation ...
评论 #11095403 未加载
评论 #11096986 未加载
评论 #11096385 未加载
评论 #11095130 未加载
评论 #11094965 未加载
SoulManover 9 years ago
Looks like build is failing !
wslhover 9 years ago
I just upvoted the same news just 4 days ago: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11069305" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11069305</a><p>There is some issue with duplicates in HN, I think points should go to the original poster, more if it&#x27;s recent.
评论 #11097419 未加载
frignover 9 years ago
Now we can at least explain with code examples why Electronic Arts Games suck so much.
评论 #11095364 未加载