Crash while loading Krita

Silvio Heinrich plassy at web.de
Mon Aug 8 20:20:19 UTC 2011


Am 08.08.2011 14:55, schrieb Cyrille Berger Skott:
> public:
>   EIGEN_MAKE_ALIGNED_OPERATOR_NEW
> 
> (and any other structure that contains a eigen vector)
> 
> 

Yes thats written in the docs but this doesn't matter since I don't use
the "standard" new operator to create the struct with the vectors.
I don't allocate memory dynamically for the struct (struct Core).
Instead I use the placement new operator that only calls the constructor
of a class on an arbitrary chunk of memory.

struct Core {
    virtual ~Core()
    virtual method() = 0;
    Vector a;
    Vector b;
};

struct Derived: public Core {
    virtual method() { /* do something */ }
}

char buffer[sizeof(Core)];
new (buffer) Derived();

reinterpret_cast<Core*>(buffer)->method();


More information about the kimageshop mailing list