9 ms·
EA open sources their internal version of STL
- ukdm 16y agoSource: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n227... Differences between std STL and EASTL First, EASTL provides a set of containers, iterators, and algorithms that are identical in interface and behavior to std STL versions with one exception: allocators. EASTL has a different allocator specification which is simpler, more efficient, more flexible, and easier to use than std::allocator. Both std::allocator and eastl::allocator are described below. EASTL follows the defect reports and TR1 as well. EASTL additionally provides and uses some of the TR1 functionality as well, including most significantly the smart pointers, type traits, and hashing containers. Second, EASTL provides extension functionality to the above containers, iterators, and algorithms. An example of this is the push_back(void), set_capacity(size), and validate() functions added to eastl::vector. The majority of these extensions are driven by the need for higher performance (push_back(void)), higher clarity (set_capacity), or higher debuggability (validate()). There are about 30 such extensions to the various entities in the library. These are described in detail below. Third, EASTL provides additional containers and algorithms that don't correspond to std STL. These include intrusive_list, vector_map, fixed_hash_set, slist, ring_buffer, radix_sort, has_trivial_relocate, and others. These are described in detail below. There are additional differences not related to the functional specification. They include a programming philosophy that emphasizes readability, consistency, and optimal performance on limited hardware.
- jparise 16y agoOther nice additions are the fixed-sized containers (fixed_vector<> and friends) and the somewhat-enhanced string<> class (which adds things like sprintf() support). I've missed all of these things greatly since leaving EA.
- Keyframe 16y agohttp://news.ycombinator.com/item?id=1798215 http://news.ycombinator.com/item?id=1798215 - barrybe set up that github. Here are first rough benchmarks: http://msinilo.pl/blog/?p=668 http://msinilo.pl/blog/?p=668
- jrockway 16y agoThis is why game companies use C++. They've already reimplemented it internally and don't ever want to do that again.
- ig1 16y agoA surprisingly large number of companies have their own STL implementations from Investment Banks to Telecoms companies. Often because they're doing funky things (often related to memory allocation) which would be outright impossible to do in languages like Java or C#.
- jrockway 16y agoI have never seen anyone mix their custom memory manager with STL. Also, who said anything about Java or C#?
- aaronblohowiak 16y agoRight, they have a custom STL because they want to have their custom memory management.
- jrockway 16y agoHere's my experience. Whenever a C++ programmer uses the word performance, it's never to describe using template-based generic data structures. I do it and the performance is fine, but the hard-core C++ programmers seem to hate STL. Incidentally, I asked someone about memory management in an interview for a C++ position. He said he wrote his own memory manager (object pool, basically), and never even bothered to use "new" or "delete". Personally, I'm sticking to Haskell...
- jparise 16y agoEASTL is essentially the reaction of a bunch of hard-core C++ programmers who hated all of the other STL implementations.
- axus 16y agoE. A. STL. It's in the game. But don't say it like that, it's against the license ;p
- w1ntermute 16y agoWhat's their reason for open sourcing it?
- pkaler 16y agoThey ported WebKit to the PS3 and Xbox 360. EA STL was used for this port. More code here: http://gpl.ea.com/ http://gpl.ea.com/
- bhickey 16y agoWhy the heck are they hosting it at http://gpl.ea.com http://gpl.ea.com when they've released the code under the 3-clause BSD license?