[fpc-devel] wrong results of function "align"

Peter Vreman peter at freepascal.org
Tue Jul 4 18:39:06 CEST 2006


At 16:03 2-7-2006, you wrote:
>fpc-2.1.1 r4075
>linux-i386
>
>If I understand the purpose of function align
>(rtl/inc/{systemh.inc,generic.inc}) correctly, it gives wrong results
>when used with pointers > $8000000.
>
>Align uses ptrint. Using ptrUint instead works.
>
>I tried using it to align a array to 4k bounds, like this:
>p:=getmem(MyAry,sizeof(MyAry)+4096); p:=align(p,4096);
>
>IMO align($80000001,$1000) should give $80001000, but gives $80002000.
>
>Attached is a testcase and a patch.

Thanks, Patch Applied


Peter




More information about the fpc-devel mailing list