Re: [eigen] Custom memory allocators with eigen

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


I don't think we require alignment for sizes below 16 bytes, so this should be fine (but I'd need to check to be sure).

Depending on the target architecture, you may however get problems if memory is not aligned to 32 byte, when allocating 32 bytes or more.

Cheers,
Christoph

On 17/03/2021 14.21, Edward Lam wrote:
On Wed, Mar 17, 2021 at 4:10 AM Alberto Luaces wrote:

FWIW, on a side note, jemalloc required defining
EIGEN_MALLOC_ALREADY_ALIGNED to 0 the last time I tried it because its
allocator didn't guarantee always 16-byte aligned pointers. For really
small allocations, it can return 8-byte aligned pointers.

Thanks for pointing that!.  In the case the wrong alignment were used,
would I expect to have a SIGSEV (or similar) or just bogus results?

As far as I recall, I ran into crashes but it wasn't obvious that it was an
alignment issue so it's possible that bogus results are possible. Having
said that, you'd need to have very small matrices to run into this.

-Edward



--
 Dr.-Ing. Christoph Hertzberg

 Besuchsadresse der Nebengeschäftsstelle:
 DFKI GmbH
 Robotics Innovation Center
 Robert-Hooke-Straße 5
 28359 Bremen, Germany

 Postadresse der Hauptgeschäftsstelle Standort Bremen:
 DFKI GmbH
 Robotics Innovation Center
 Robert-Hooke-Straße 1
 28359 Bremen, Germany

 Tel.:     +49 421 178 45-4021
 Zentrale: +49 421 178 45-0
 E-Mail:   christoph.hertzberg@xxxxxxx

 Weitere Informationen: http://www.dfki.de/robotik
  -------------------------------------------------------------
  Deutsches Forschungszentrum für Künstliche Intelligenz GmbH
  Trippstadter Straße 122, D-67663 Kaiserslautern, Germany

  Geschäftsführung:
  Prof. Dr. Antonio Krüger (Vorsitzender)
  Dr. Walter Olthoff

  Vorsitzender des Aufsichtsrats:
  Dr. Gabriël Clemens
  Amtsgericht Kaiserslautern, HRB 2313
  -------------------------------------------------------------



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/