On 04/03/2010 02:12 PM, Jonas Maebe wrote:
>   
> From Linux' malloc man page:
>
> 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.
>   
Hmm. What does "suitable" mean ? With many embedded CPUs alignment is
forced to prevent runtime errors. With an X86 any alignment is allowed
but performance is different Of course for Integers and Pointers  Dword
alignment (or QWord for 64 Bit systems) is appropriate (and supposedly
provided by malloc. But with Vectors (and long Reals) more strict
alignment might be faster. malloc() does not handle this. The C library
provides calloc() for this purpose, but I don't know how this exactly
works. I suppose it is implementation-depending.

-Michael
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to