The alignment and padding recommendations from the columnar format
documents only applies to memory buffers allocated to represent Arrow
vectors/arrays, not for memory allocation for other data structures /
classes / objects more generally in any of the libraries.

The rest of the C++ codebase delegates most memory allocation for C++
objects to the language defaults / STL defaults — so if the STL by
default (e.g. std::vector, std::shared_ptr and APIs like make_shared)
is in conflict with -qopt-assume-safe-padding then you have your
answer. We do have an STL-compatible allocator wrapper that could be
used to make all memory allocations aligned and padded, but it would
be a hardship to refactor the codebase to be used consistently in all
places where memory is allocated by the STL.

On Fri, Aug 5, 2022 at 12:42 AM James <[email protected]> wrote:
>
> Perhaps the thing I’m misunderstanding is that the compiler flag in question 
> only pertains to data loaded in an AVX register?
>
> On Thu, Aug 4, 2022 at 9:14 PM James <[email protected]> wrote:
>>
>> In the columnar format doc, it is noted that buffers ought to be allocated 
>> such that they're 64 byte aligned and padded. It is also noted that this 
>> allows the use of compiler options such as -qopt-assume-safe-padding. 
>> However, my understanding of -qopt-assume-safe-padding is that all heap 
>> allocations need to be 64 byte aligned and padded. Is this consistent with 
>> the use of std::make_shared?  Perhaps I'm missing something, but it looks 
>> like there are many heap allocations throughout the cpp code that are not 64 
>> byte aligned and padded. Is it the intention that only the columnar buffer 
>> data be aligned and padded. If yes, then does the use of std::make_shared 
>> make use of -qopt-assume-safe-padding not possible?

Reply via email to