You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by Andy Grove <an...@gmail.com> on 2018/04/28 14:55:32 UTC

Struct memory format question

I have implemented structs in Rust as a vector of Arrays. Each nested array
uses a byte-aligned contiguous region of memory, but the array for field 2
is not contiguous with the array for field 1.

Is this "compliant" ?

I have been reading layout.md and I don't think it is clear but it seems to
suggest that all the nested arrays should be contiguous to each other in
memory?

Thanks,

Andy.

Re: Struct memory format question

Posted by Andy Grove <an...@gmail.com>.
Thanks, Antoine. I was hoping that was the case. I filed a PR to make this
more specific in the spec.

https://github.com/apache/arrow/pull/1959

This is filed under a Rust issue where this question came about.

Thanks,

Andy.

On Sat, Apr 28, 2018 at 9:35 AM, Antoine Pitrou <an...@python.org> wrote:

>
> Le 28/04/2018 à 16:55, Andy Grove a écrit :
> > I have implemented structs in Rust as a vector of Arrays. Each nested
> array
> > uses a byte-aligned contiguous region of memory, but the array for field
> 2
> > is not contiguous with the array for field 1.
>
> Child arrays of a nested arrays do not have to be contiguous with one
> another.  They are truly independent arrays that just happen to be
> related through their usage in the nested array.
>
> Regards
>
> Antoine.
>

Re: Struct memory format question

Posted by Antoine Pitrou <an...@python.org>.
Le 28/04/2018 à 16:55, Andy Grove a écrit :
> I have implemented structs in Rust as a vector of Arrays. Each nested array
> uses a byte-aligned contiguous region of memory, but the array for field 2
> is not contiguous with the array for field 1.

Child arrays of a nested arrays do not have to be contiguous with one
another.  They are truly independent arrays that just happen to be
related through their usage in the nested array.

Regards

Antoine.