jhorstmann commented on a change in pull request #505:
URL: https://github.com/apache/arrow-rs/pull/505#discussion_r660740580
##########
File path: arrow/src/array/data.rs
##########
@@ -354,12 +354,7 @@ impl ArrayData {
/// Returns the total number of bytes of memory occupied physically by
this [ArrayData].
pub fn get_array_memory_size(&self) -> usize {
- let mut size = 0;
- // Calculate size of the fields that don't have
[get_array_memory_size] method internally.
- size += mem::size_of_val(self)
- - mem::size_of_val(&self.buffers)
Review comment:
This should be fixed now, I added one more assertion for this case:
```
// expected size is the size of the PrimitiveArray struct,
// which includes the optional validity buffer
// plus one buffer on the heap
assert_eq!(
std::mem::size_of::<PrimitiveArray<Int64Type>>() +
std::mem::size_of::<Buffer>(),
empty_with_bitmap.get_array_memory_size()
);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]