[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The --with-wide-int build and Lisp_Sub_Char_Table assertion
From: |
Eli Zaretskii |
Subject: |
Re: The --with-wide-int build and Lisp_Sub_Char_Table assertion |
Date: |
Mon, 12 Jan 2015 19:26:35 +0200 |
> Date: Mon, 12 Jan 2015 20:03:29 +0300
> From: Dmitry Antipov <address@hidden>
> CC: address@hidden
>
> On 01/12/2015 07:29 PM, Eli Zaretskii wrote:
>
> > In the 32-bit MinGW configuration with wide integers, we have:
> >
> > offsetof (struct Lisp_Sub_Char_Table, contents) = 16
> > offsetof (struct Lisp_Sub_Char_Table, depth) = 4
> > word_size = 8
>
> OK, but...
>
> > header_size = 8
> > offsetof(struct Lisp_Vector, contents) = 8
>
> ==> sizeof(ptrdiff_t) is 8 in a 32-bit configuration?
No, it's 4, of course.
> Or, if sizeof(ptrdiff_t) is 4, what is sizeof(struct vectorlike_header)?
Also 4.
> IIUC it should be 4, and so header_size should be 4 too...
This is exactly the flaw: the assumption that if the size of 'struct
vectorlike_header' is 4, the offset of the next struct member is also
4. In reality, a compiler can add padding, and evidently here it did,
probably to get that member aligned an a 8-byte boundary.
What I'm saying IOW is that instead of assuming the above, why not
simply use header_size as computed already, since that's what you use
in PSEUDOVECSIZE?