This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Does malloc tell us anything about alignment modulo k?


On Thu, Jul 15, 2004 at 12:56:23PM -0400, Geert Bosch wrote:
> The other problem is that when you know you need memory that is
> more aligned than what malloc guarantees, you'll have to figure
> out what routines are available for allocation, and how this
> memory needs to be deallocated. Not all memaligns are compatible
> with malloc's free() either, although I believe posix_memalign is.
> It's a bit of a mess...

POSIX requires posix_memalign to be freeable by free() and I doubt anybody
implements function posix_memalign which doesn't have POSIX semantics.
In glibc, posix_memalign is a wrapper around memalign, so glibc memalign
can be freed by free() too.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]