1
0
Fork 0

Fix memory alignment

Fix SSE dependent classes not being properly aligned when created on the
heap.
This commit is contained in:
mrgreywater 2015-09-21 14:04:07 +02:00
parent 00c66d1bd1
commit 11ac2a3a52
4 changed files with 26 additions and 0 deletions

View File

@ -426,3 +426,13 @@ void CPUSideBar::drawStraightArrow(QPainter* painter, int x1, int y1, int x2, in
} }
void* CPUSideBar::operator new(size_t size)
{
return _aligned_malloc(size, 16);
}
void CPUSideBar::operator delete(void* p)
{
_aligned_free(p);
}

View File

@ -13,6 +13,9 @@ public:
QSize sizeHint() const; QSize sizeHint() const;
void drawStraightArrow(QPainter* painter, int x1, int y1, int x2, int y2); void drawStraightArrow(QPainter* painter, int x1, int y1, int x2, int y2);
static void* operator new(size_t size);
static void operator delete(void* p);
public slots: public slots:
void debugStateChangedSlot(DBGSTATE state); void debugStateChangedSlot(DBGSTATE state);
void repaint(); void repaint();

View File

@ -1289,6 +1289,16 @@ QSize RegistersView::sizeHint() const
return QSize(32 * mCharWidth , this->viewport()->height()); return QSize(32 * mCharWidth , this->viewport()->height());
} }
void* RegistersView::operator new(size_t size)
{
return _aligned_malloc(size, 16);
}
void RegistersView::operator delete(void* p)
{
_aligned_free(p);
}
QString RegistersView::getRegisterLabel(REGISTER_NAME register_selected) QString RegistersView::getRegisterLabel(REGISTER_NAME register_selected)
{ {
char label_text[MAX_LABEL_SIZE] = ""; char label_text[MAX_LABEL_SIZE] = "";

View File

@ -94,6 +94,9 @@ public:
QSize sizeHint() const; QSize sizeHint() const;
static void* operator new(size_t size);
static void operator delete(void* p);
public slots: public slots:
void refreshShortcutsSlot(); void refreshShortcutsSlot();
void updateRegistersSlot(); void updateRegistersSlot();