Returns the total number of bytes of memory occupied physically by this [`ArrayData`] and all its [`Buffer`]s and children. (See also diagram on [`ArrayData`]). Equivalent to: `size_of_val(self)` + [`Self::get_buffer_memory_size`] + `size_of_val(child)` for all children
(&self)
| 569 | /// [`Self::get_buffer_memory_size`] + |
| 570 | /// `size_of_val(child)` for all children |
| 571 | pub fn get_array_memory_size(&self) -> usize { |
| 572 | let mut size = mem::size_of_val(self); |
| 573 | |
| 574 | // Calculate rest of the fields top down which contain actual data |
| 575 | for buffer in &self.buffers { |
| 576 | size += mem::size_of::<Buffer>(); |
| 577 | size += buffer.capacity(); |
| 578 | } |
| 579 | if let Some(nulls) = &self.nulls { |
| 580 | size += nulls.buffer().capacity(); |
| 581 | } |
| 582 | for child in &self.child_data { |
| 583 | size += child.get_array_memory_size(); |
| 584 | } |
| 585 | |
| 586 | size |
| 587 | } |
| 588 | |
| 589 | /// Creates a zero-copy slice of itself. This creates a new |
| 590 | /// [`ArrayData`] pointing at the same underlying [`Buffer`]s with a |