|
From: Jeffrey S. <fe...@xi...> - 2003-11-24 15:16:37
|
On Mon, 2003-11-24 at 06:32, Nicholas Nethercote wrote:
> On Mon, 24 Nov 2003, Salim SAYOURI wrote:
>
> > It seems that the pointers used in Judy array are aligned on 8 bytes! And
> > launching valgrind with the option --alignment=8 solves the problem.
>
> This is a fairly common problem... perhaps we should just change
> Valgrind's allocator to align heap blocks on 8-byte boundaries? I know
> that programs should, strictly speaking, be able to handle 4-byte
> alignments.
I'm not sure this is true. Most programs expect that malloc will return
a memory buffer aligned to be suitable for any data storage.
see the man page for malloc:
RETURN VALUE
For calloc() and malloc(), the value returned is a pointer to the
allo-
cated memory, which is suitably aligned for any kind of
variable, or
NULL if the request fails.
on x86, this would be 8.
Jeff
> But it does cause difficult-to-understand problems with
> Memcheck. Not sure.
>
> N
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive? Does it
> help you create better code? SHARE THE LOVE, and help us help
> YOU! Click Here: http://sourceforge.net/donate/
> _______________________________________________
> Valgrind-users mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
>
|