i have a quite strange problem. my class has -among others-
following memers:
GLboolean has_alpha;
GLuint width;
GLuint height;
GLuint length;
GLuint millisPerFrame;
GLfloat uv[2];
GLuint texsize[2];
GLint compsize;
// location2
long preload_interval_next;
long preload_interval;
if i put the has_alpha at (location2) i get
a) different object size, sizeof reports 248 instead of 252 bytes
and
b) hefty heap corruptions
GLboolean is defined as unsigned char, but since i use NO optimization at all
( double checked this ) this should be padded to 4 bytes anyway.
And in the end, if it pads, it should do it at both locations ..
compilers tested: CLANG ( c++ ), GCC4.2 com.apple.compilers.llvmgcc42
Anyone an idea how to track this down?
The problem here is almost certainly not in the members you have listed, but another one, possibly an
int, pointer orboolthat is not properly initialised in the constructor. Please post a larger example that fails, and make sure you initialise all members using the constructor initialisation list.