I have a struct alignedStruct
, and it requires special alignment (SEE ext):
void* operator new(size_t i) { return _aligned_malloc(i, 16); }
void operator delete(void* p) { _aligned_free(p); }
This alignment works fine for unique objects/pointers of alignedStruct
, but then I tried to do this:
alignedStruct * arr = new alignedStruct[count];
My application crashes, and the problem is definitely about "alignment of array" (exactly at previous line):
0xC0000005: Access violation reading location 0xFFFFFFFF.
Such crash occur in ~60% of times, also indicates problem is not typical.