Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Alignment Issues with *ManagedStruct?

Newsgroups: perl.perl6.internals
Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.stanford.edu!nntp.perl.org
Return-Path: <lu...@debian.org>
Mailing-List: contact perl6-internals-h...@perl.org; run by ezmlm
Delivered-To: mailing list perl6-intern...@perl.org
Received: (qmail 80450 invoked by uid 76); 6 Feb 2004 09:30:58 -0000
Received: from x1.develooper.com (HELO x1.develooper.com) (63.251.223.170) by onion.perl.org (qpsmtpd/0.26) with SMTP; Fri, 06 Feb 2004 01:30:58 -0800
Received: (qmail 1063 invoked by uid 225); 6 Feb 2004 09:30:51 -0000
Delivered-To: perl6-intern...@perl.org
Received: (qmail 32102 invoked by alias); 6 Feb 2004 09:30:44 -0000
Received: from [151.42.100.166] (HELO luna.wolf.it) (151.42.100.166)  by la.mx.develooper.com (qpsmtpd/0.27-dev) with ESMTP; Fri, 06 Feb 2004 01:30:44 -0800
Received: by luna.wolf.it (Postfix, from userid 1000)	id F0F8F2EF94; Fri,  6 Feb 2004 10:31:26 +0100 (CET)
Date: Fri, 6 Feb 2004 10:31:25 +0100
To: perl6-intern...@perl.org
Subject: Re: Alignment Issues with *ManagedStruct?
Message-ID: <20040206093125.GP28812@debian.org>
Mail-Followup-To: perl6-intern...@perl.org
References: <1075845748.23721.32.camel@localhost> <200402040852.i148qYa10172@thu8.leo.home> <1075925266.25662.28.camel@localhost> <200402051023.i15ANdK10683@thu8.leo.home> <x71xp9zb4e.fsf@mail.sysarch.com> <200402051821.i15ILgo03637@thu8.leo.home> <x74qu5xn6d.fsf@mail.sysarch.com> <200402052315.i15NFhV04715@thu8.leo.home> <x7broduka4.fsf@mail.sysarch.com> <x7y8rhszmo.fsf@mail.sysarch.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <x7y8rhszmo.fsf@mail.sysarch.com>
User-Agent: Mutt/1.5.5.1+cvs20040105i
X-SMTPD: qpsmtpd/0.26, http://develooper.com/code/qpsmtpd/
Approved: n...@nntp.perl.org
From: lu...@debian.org (Paolo Molaro)

On 02/05/04 Uri Guttman wrote:
> with this struct (from leo with some minor changes):
> 
> struct xt {
> 	char x;
> 	struct yt {
> 		char i,k;
> 		int  j;
> 	} Y;
> 	char z;
> } X;
> 
> and this trivial script (i pass the filename on the command line):
[...]
> i get this lovely output:
> 
> struct yt
>         char i : offset 0
>         char k : offset 1
>         int j : offset 2
> struct xt
>         char x : offset 0
>         struct yt Y : offset 1
>         char z : offset 7
[...]
> BTW, this was on a sparc/solaris box.

The offsets look incorrect. On basically every modern 32 or 64 bit
OS (with sizeof(int) == 4) it should look like:

struct yt (size=8, alignment=4)
        char i : offset 0
        char k : offset 1
        int j : offset 4

struct xt (size=16, alignment=4)
        char x : offset 0
        struct yt Y : offset 4
        char z : offset 12

lupus

-- 
-----------------------------------------------------------------
lu...@debian.org                                     debian/rules
lu...@ximian.com                             Monkeys do it better