Re: glib / CORBA integration examples ...



On Thu, 12 Sep 2002, Sam Couter wrote:

> Michael Meeks <michael@ximian.com> wrote:
> > to glib users I imagine [ Tim ? ], a sticking point might be strings
> > there - we currently offset the pointer to tag it as a string, rather
> > than using a full smart header to save space there; can glib accept a
> 
> Which reminds me... Where does ORBit do whatever it needs to do in order
> to guarantee that all memory allocations are aligned to two-byte
> boundaries? Depending on the allocator and hardware alignment
> restrictions, this is not always true. Things break rather badly when a
> string is freed using a bogus smart allocation header.

Malloc and calloc is required to return memory that is suitably aligned
for storing any variable in it - hence you have the quarantee that no
additional tweaking on the returned pointer is needed. I somehow imagine
you have a lot more problems than Orbit if you use an allocator not
matching this requirement on a machine with aligmnet restrictions.

> -- 
> Sam "Eddie" Couter  |  mailto:sam@topic.com.au
> Internet Engineer   |  jabber:sam@jabber.topic.com.au
> tSA Consulting      |  http://www.topic.com.au/
> OpenPGP fingerprint:  A46B 9BB5 3148 7BEA 1F05  5BD5 8530 03AE DE89 C75C
> 

	Sander

	This is the place where all
	the junkies go	
	where time gets fast
	but everything gets slow





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