Re: CORBA_double on SGI



Simon Britnell <simon britnell peace com> wrote:
> I think this is a problem with the size of the memory allocation header 
> that ORBit prefixes to memory blocks it allocates.  The problem is that 
> ORBit calls malloc to allocate (header_size+requested_size) bytes, sets 
> values in the header and returns the pointer offset past the header.  If 
> that offset is not a 64 bit boundary, the doubles don't fall on a 64 bit 
> boundary and when the instruction is executed to fetch them, it 
> generates a SEGV.  I have a patch for this which I didn't post because 
> it added unnecessary padding in most cases.  I'll clean it up and post 
> it within the next 24 hrs.

Why is the ORBit_mem_info struct not a union with some alignment-restricted
type? That has to be the easiest way to solve alignment problems.

See the C bible ("The C Programming Language"), second edition, section 8.7
for more details.
-- 
Sam Couter          |   Internet Engineer   |   http://www.topic.com.au/
sam topic com au    |   tSA Consulting      |
OpenPGP key available on key servers
OpenPGP fingerprint:  A46B 9BB5 3148 7BEA 1F05  5BD5 8530 03AE DE89 C75C




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]