This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
------- Additional Comments From jason at gcc dot gnu dot org 2004-06-08 18:04 -------
Here is a more elegant workaround:
#include <xmmintrin.h>
#include <stdio.h>
#include <stdlib.h>
#include <new>
class Vector4
{
public:
Vector4() { vec = _mm_setzero_ps(); }
void *operator new (size_t);
void *operator new[] (size_t size) { return operator new (size); }
__m128 vec;
};
void *Vector4::operator new (size_t size)
{
void *p;
int r = posix_memalign (&p, __alignof (Vector4), size);
if (r)
throw std::bad_alloc ();
return p;
}
int main(int argc, char **argv)
{
Vector4 *foo = new Vector4[200*200];
delete foo;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15795
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |