GSdx: another example why unions are not portable, this even fails between vc x86 and x64, m_vm8 is placed at offset 0, m_vm16/m_vm32 at offset 8 of the anon union.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4376 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gabest11 2011-02-27 09:03:51 +00:00
parent 10382197c8
commit 34749b1406
2 changed files with 5 additions and 1 deletions

View File

@ -84,6 +84,8 @@ GSLocalMemory::GSLocalMemory()
: m_clut(this)
{
m_vm8 = (uint8*)vmalloc(m_vmsize * 2, false);
m_vm16 = (uint16*)m_vm8;
m_vm32 = (uint32*)m_vm8;
memset(m_vm8, 0, m_vmsize);

View File

@ -94,7 +94,9 @@ public:
static const int m_vmsize = 1024 * 1024 * 4;
union {uint8* m_vm8; uint16* m_vm16; uint32* m_vm32;};
uint8* m_vm8;
uint16* m_vm16;
uint32* m_vm32;
GSClut m_clut;