Vector Class Discussion

gcc vector class+std::list crash
Author: Agner Date: 2013-10-23 00:09
My guess is that it is an alignment issue. It is possible that std::list allocates a memory block that is not aligned by 16 and push_back does something that assumes that the vector is aligned by 16. You may try to debug into it to see if this is the problem.

I would never use the standard template library (STL) on speed-critical applications (see my C++ manual). If you can set a reasonable maximum size for your list at compile time then just use a simple array. This is the fastest solution. If you need an array with dynamic size then you may use AlignedArray from www.agner.org/optimize/cppexamples.zip

 
thread gcc vector class+std::list crash new - Marco Belli - 2013-10-22
reply gcc vector class+std::list crash - Agner - 2013-10-23
last replythread more on vectorclass and STL problems new - renato talucci - 2014-10-21
last reply more on vectorclass and STL problems new - Agner - 2014-10-21