[cgma-dev] cgm-cubit on 32 bit machine
    Jason Kraftcheck 
    kraftche at cae.wisc.edu
       
    Fri Jul  1 13:56:12 CDT 2011
    
    
  
On 07/01/2011 12:34 PM, Iulian Grindeanu wrote:
> OK, 
> it is 124 from sizeof, compared to 136 from your code snippet.
> So buff[12] would do it. 
> This crash appears only on 32 bit. 
> 
> Running this on 64 bit machine it shows that we are lucky it doesn't crash 
> on 64 bit, because : 
> CCubitFile constructor touched 208 bytes
> sizeof (NCubitFile::CCubitFile): 192
> 
> Probably we would want to add some buffer for 64 bit too.
> 
Adding the following would make both exactly the right size:
int pad1[2];
long pad2;
But perhaps it would be better to go with the simpler solution, as
allocating too much space isn't a problem.
char pad[16];
- jason
    
    
More information about the cgma-dev
mailing list