[Insight-developers] Empty FixedArray destructor: Performancehit using gcc (times 2)
Luis Ibanez
luis.ibanez at kitware.com
Sat Jun 7 07:37:01 EDT 2008
Hi Mathieu,
Thanks for pointing this out.
"size_t" may be a candidate here.
http://msdn.microsoft.com/en-us/library/3b2e7499(VS.80).aspx
a second option may be "ptrdiff_t",
A modification has been committed by using size_t,
we will follow up on the Dashboard...
Thanks,
Luis
------------------------
Mathieu Coursolle wrote:
> Hi ITK Developers,
>
> I just tried to build ITK in 64 bits (x86_64 and ppc64) and ran into
> itkFixedArrayTest2 that was just added.
>
> Part of the code goes like this:
>
> ArrayType * vec = new ArrayType[nelements+8];
>
> // Fill it up with zeros
> memset(vec,0,(nelements+8)*sizeof(ArrayType));
>
>
> // Display the alignment of the array
> std::cout << "Initial alignment: " << (((int)vec)& 7) << "\n";
>
> As I built 64 bits, vec is a 64 bits pointer. Trying to cast it as an
> int, which is 32 bits, cause a compiler error
> on my machine (intel mac).
>
> Is there some type like uintptr_t that could be use, which will be 32
> bits when built as 32, and 64 bits when built as 64?
>
> Thanks.
>
> Mathieu
More information about the Insight-developers
mailing list