Skip to content

Commit

Permalink
ARROW-8320: [Format] Add clarification to CDataInterface.rst regardin…
Browse files Browse the repository at this point in the history
…g memory alignment of buffers

This recommends at least a minimum alignment based on the type of data the buffer contains. For example, if the buffer contains `int32_t` data, then a minimum of 4-byte alignment is recommended.

If an Arrow implementation finds unaligned memory burdensome due to aliasing issues or undefined behavior, this also clarifies that they are not expected to support it.

Closes #6840 from wesm/ARROW-8320

Authored-by: Wes McKinney <wesm+git@apache.org>
Signed-off-by: Antoine Pitrou <antoine@python.org>
  • Loading branch information
wesm authored and pitrou committed Apr 6, 2020
1 parent 2d75965 commit 96a2522
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/source/format/CDataInterface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,10 @@ It has the following fields:
represent `length + offset` values encoded according to the
:ref:`Columnar format specification <format_columnar>`.

It is recommended, but not required, that the memory addresses of the
buffers be aligned at least according to the type of primitive data that
they contain. Consumers MAY decide not to support unaligned memory.

The pointer to the null bitmap buffer, if the data type specifies one,
MAY be NULL only if :c:member:`ArrowArray.null_count` is 0.

Expand Down

0 comments on commit 96a2522

Please sign in to comment.