This simple SSE code:
#include <vector>
#include <emmintrin.h>
int main() {
std::vector<__m128> blah;
blah.push_back(__m128());
}
Crashes on MSVC 10 with a segfault at 0xffffffff.
What could be going wrong ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A
std::vectordoes not allocate specially aligned memory, which__m128needs to store it’s data. You will have to either swap out the allocator, or replace it with an array of 4 floats and then perform an unaligned load or copy out to an aligned location every time you access the vector.