Is it possible to tell ITK to allocate aligned memory?


Is there some way to tell ITK to allocate images at e.g. 16-byte-aligned locations, or is there some way to pass ITK a custom allocator that does this?

I have gone through the code and suspect not. Looking to have my suspicion confirmed or disproved.

Does itkAlignedTypedef from itkMacro.h not satisfy your requirements?

1 Like

Yes it does! Thank you for pointing out this macro.

@kaspermarstal Looks like C++11 has such a feature as well: :smile:

HTH, Niels

1 Like

If it works across all our target compilers, perhaps the itkAlignedTypedef macro should be updated to use alignas instead of compiler specific specifiers? The code would be simpler and would work across non-specifically targeted compilers too.