langmead-lab / vargas

MIT License
25 stars 2 forks source link

Fixed: Segmentation Fault for AVX{2,512} #3

Closed dnbaker closed 4 years ago

dnbaker commented 4 years ago

new and malloc calls default to memory alignment of 128 bits in the current C standard. Because of this, the allocation of the AlignerT needs itself to be aligned with vector width, which was leading to segmentation faults because of unaligned memory.

This patch uses an allocation aligned to 64 bytes for the aligners and uses a custom Deleter class to call std::free during their destructors, which seems to eliminate the bug.