From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 45636BC37 for ; Wed, 27 Jan 2010 22:20:33 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AukBAJM8YEvZSMDqi2dsb2JhbACBNJofAQEBCgsKBxEFvRGEOQQ X-IronPort-AV: E=Sophos;i="4.49,356,1262559600"; d="scan'208";a="42316210" Received: from fmmailgate03.web.de ([217.72.192.234]) by mail2-smtp-roc.national.inria.fr with ESMTP; 27 Jan 2010 22:20:32 +0100 Received: from smtp08.web.de (fmsmtp08.dlan.cinetic.de [172.20.5.216]) by fmmailgate03.web.de (Postfix) with ESMTP id 7447E13CBC4AA; Wed, 27 Jan 2010 22:20:32 +0100 (CET) Received: from [95.208.117.111] (helo=frosties.localdomain) by smtp08.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #314) id 1NaFJQ-00068x-00; Wed, 27 Jan 2010 22:20:32 +0100 Received: from mrvn by frosties.localdomain with local (Exim 4.71) (envelope-from ) id 1NaF1L-0003HP-Ki; Wed, 27 Jan 2010 22:01:51 +0100 From: Goswin von Brederlow To: Pascal Cuoq Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Alignment of data References: <20100127161719.C6A10BC37@yquem.inria.fr> Date: Wed, 27 Jan 2010 22:01:51 +0100 In-Reply-To: (Pascal Cuoq's message of "Wed, 27 Jan 2010 17:38:13 +0100") Message-ID: <873a1rntxc.fsf@frosties.localdomain> User-Agent: Gnus/5.110009 (No Gnus v0.9) XEmacs/21.4.22 (linux, no MULE) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: goswin-v-b@web.de X-Sender: goswin-v-b@web.de X-Provags-ID: V01U2FsdGVkX1/gqvUm9eG1cTPjEs2clqNbSx4hDuBeS7Fh6mm+ kAufLlpZmgmHkKqjAsyvhu1XSp+yuzI3NAbApqlH+ufasMihE5 BU4ZKZ3dk= X-Spam: no; 0.00; alignment:01 cuoq:01 cuoq:01 alloc:01 mlsize:01 alignment:01 byte:01 condemns:01 compactions:01 arrays:01 gcc:01 byte:01 inserting:01 compaction:01 mfg:98 Pascal Cuoq writes: > Goswin von Brederlow wrote: > > > You need to write a new function > > CAMLextern value caml_alloc_double_array (mlsize_t), > > or similar that ensures alignment on 8 byte for double even for 32bit > systems. > > You should also check the CAMLextern value caml_copy_double (double); > that it does the same. > > > If you decide to go this route, which this message > neither endorses not condemns, you also need to > > A1/ allocate the doubles directly in the major heap, and > A2/ deactivate compactions > > or > > B/ modify the garbage-collector. > > Pascal Doubles are tagged with Double_tag and arrays of doubles with Double_array_tag. So the GCC knows where doubles are. Would it be hard to patch the allocation to leave a 4 byte gap in the minor heap when needed to align doubles and patch the compation to do the same? The 4 bytes would mean inserting an Atom(0) during allocation and compaction. Not the nicest way to do this but should be simple to patch in. MfG Goswin