bug-gnulib
[Top][All Lists]
Advanced

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

[Bug-gnulib] fwd: obstack default alignment


From: Benno
Subject: [Bug-gnulib] fwd: obstack default alignment
Date: Tue, 10 Aug 2004 11:34:07 +1000
User-agent: Mutt/1.5.6i

Hi,

This originally went to the glibc list. It was suggested
I copy here as more people might actually the obstack functions.

Cheers,

Benno

----- Forwarded message from Benno <address@hidden> -----

Date: Tue, 10 Aug 2004 09:35:54 +1000
From: Benno <address@hidden>
Subject: obstack default alignment
Message-ID: <address@hidden>
To: address@hidden
User-Agent: Mutt/1.5.6i

There appears to be inconsistency in the alignment of memory returned
by different memory allocation routines in libc. Specifically malloc
is defined to allocate memory that is aligned to hold any data type.
(Which to me seems to be sane behaviour.)

By constrast obstack_alloc is defined to return memory aligned to 4 bytes.
*But* it actually calculates default alignmnet to be big enough to hold a
double (which is often the largest alignment needed, but not on Itanium).

I would have thought it made sense to set the default alignment in the same
way as malloc(). However failing shouldn't the code actually implement the
docs and set the alignment to 4, rather than calculating?

Cheers,

Benno

----- End forwarded message -----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]