SpectralCascade / Ossium

Ossium is a bare-bones game engine built in C++ with only essential dependencies.

Home Page:https://ossiumengine.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Schemas don't work (seg fault)

SpectralCascade opened this issue · comments

Works fine on my 64-bit Windows system (AMD Ryzen 7 CPU) with mingw and codeblocks (using C++ 17 standard with GCC), however causes a segfault on my dual-core 1-ghz laptop (Linux, I think an AMD cpu). Seems plausible that the memory layouts are different :/ though I'd be surprised as I'm using GCC for both builds.

Highly suspect this is because the unit test classes use a virtual function to run the test, which changes the layout of class objects in memory. Unfortunately this is compiler specific, so it will work on some compilers but not all at present. However, I believe this has a fairly simple fix - rather than relying purely on sizeof() to calculate member offsets I can potentially setup a static instance of a schema and calculate the offset of each member using the pointer to that instance and subtract it from a particular member to get that member's offset in memory.

Fixed as per my last comment