[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Pnet-developers] ILTypeIdentical
From: |
Simon Posnjak |
Subject: |
Re: [Pnet-developers] ILTypeIdentical |
Date: |
Mon, 25 Oct 2004 12:00:57 +0200 |
V pon, 25.10.2004 ob 10:58 je Rhys Weatherley napisal(a):
> It should only be necessary for the start of a malloc'ed region to be
> aligned.
> The ILType pointers refer to the start of a structure, not something in the
> middle. The alignment of other fields shouldn't matter.
>
> I think however I am beginning to see the true problem. ILType structures
> are
> normally allocated from a memory pool, which allocates structures on a
> multiple of IL_BEST_ALIGNMENT (defined in "include/il_align.h").
>
> Pnet tries to automagically determine the best alignment by measuring
> structure padding. If, as you say, gcc packs everything with a sub-4
> alignment value, then this could cause IL_BEST_ALIGNMENT to end up being 1 or
> 2 or something similarly small.
>
> This is easy to fix. Add the following to the end of "il_align.h":
>
> #ifdef cris
> #undef IL_BEST_ALIGNMENT
> #define IL_BEST_ALIGNMENT 4
> #endif
>
> where "cris" is whatever macro you need to use to detect your CPU.
THANK YOU! That did the trick. I just successfully run helloWorld
example on CRIS.
I will sent the patches in a few hours.
Regards Simon