Sender: nate AT cartsys DOT com Message-ID: <37AC6FF0.91231064@cartsys.com> Date: Sat, 07 Aug 1999 10:42:08 -0700 From: Nate Eldredge X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.10 i586) MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: Data Alignment for Optimal Access References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com In a thread from djgpp AT delorie DOT com Eli Zaretskii wrote: > > On Thu, 5 Aug 1999, Duncan Coutts wrote: > > Dynamic storage seems the only other possibility. > > The new operator aligns allocations to 4 byte boundaries. > > Are you sure? malloc aligns on 8-byte boundary, so how come new doesn't? Reminds me that I'd been wondering about implementing `memalign' for DJGPP. I think it's a BSD invention. The glibc manual documents it as: - Function: void * memalign (size_t BOUNDARY, size_t SIZE) The `memalign' function allocates a block of SIZE bytes whose address is a multiple of BOUNDARY. The BOUNDARY must be a power of two! The function `memalign' works by allocating a somewhat larger block, and then returning an address within the block that is on the specified boundary. and also the special case `valloc', where `valloc(n)' == `memalign(getpagesize(), n)'. -- Nate Eldredge nate AT cartsys DOT com