emacs-devel
[Top][All Lists]
Advanced

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

Re: malloc and alignment


From: Miles Bader
Subject: Re: malloc and alignment
Date: Mon, 16 Jun 2003 18:35:26 -0400
User-agent: Mutt/1.3.28i

On Mon, Jun 16, 2003 at 10:38:50AM -0400, Stefan Monnier wrote:
> So all we need is to make sure that those 8KB are properly aligned.
> But how can I do that ?
> It seems the only reliable way is to malloc 16KB and then waste
> the 8KB that happen to be before/after the aligned part.
> 
> Should I just wrap malloc in my own malloc_aligned such that
> malloc_aligned calls malloc to allocate chunks of say 1MB
> and then gives them out in aligned packets of 8KB ?

You could use `memalign'....

-Miles
-- 
"Though they may have different meanings, the cries of 'Yeeeee-haw!' and
 'Allahu akbar!' are, in spirit, not actually all that different."




reply via email to

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