From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: malloc and alignment Date: Mon, 16 Jun 2003 18:35:26 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20030616223526.GA8010@gnu.org> References: <200306161438.h5GEcodM011551@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1055802924 20513 80.91.224.249 (16 Jun 2003 22:35:24 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 16 Jun 2003 22:35:24 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Jun 17 00:35:21 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19S2ZN-0005KU-00 for ; Tue, 17 Jun 2003 00:35:21 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19S2wz-0001Mu-00 for ; Tue, 17 Jun 2003 00:59:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19S2b6-0003hx-Tf for emacs-devel@quimby.gnus.org; Mon, 16 Jun 2003 18:37:08 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19S2ao-0003fZ-U3 for emacs-devel@gnu.org; Mon, 16 Jun 2003 18:36:50 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19S2aj-0003ZO-7f for emacs-devel@gnu.org; Mon, 16 Jun 2003 18:36:45 -0400 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19S2ZZ-00035X-9K for emacs-devel@gnu.org; Mon, 16 Jun 2003 18:35:33 -0400 Original-Received: from miles by fencepost.gnu.org with local (Exim 4.20) id 19S2ZS-00029u-Fc; Mon, 16 Jun 2003 18:35:26 -0400 Original-To: Stefan Monnier Content-Disposition: inline In-Reply-To: <200306161438.h5GEcodM011551@rum.cs.yale.edu> User-Agent: Mutt/1.3.28i Blat: Foop X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:15140 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:15140 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."