I get out of range. When I allocate a vector<int> of just some element in size the program stops immediately throwing out_of_range error. If I allocate a 10000 sized vector it runs for a while. What I want to do is allocate whenever myHits runs out of room. What am I doing wrong?
Why are you doing that!? Vectors will resize and reallocate themselves for you when you use push_back(). You can request capacity ahead of time with reserve(), but you should allow it to resize itself always - otherwise there is no benefit from it over a dynamic array with new[] and delete[].
LB - I know, I used push_back but I thought push_back was hurting performance so I wanted to compare with reallocating a vector, or resize if you will. Is this all wrong..? I jam in some 1000 elements in each myHits/thread.