* garrow_mutable_buffer_slice: * @buffer: A #GArrowMutableBuffer. * @offset: An offset in the buffer data in byte. * @size: The number of bytes of the sliced data. * * Returns: (transfer full): A newly created #GArrowMutableBuffer that * shares data of the base #GArrowMutableBuffer. The created * #GArrowMutableBuffer has data start with offset from the base * buffer data and are the
| 478 | * Since: 0.3.0 |
| 479 | */ |
| 480 | GArrowMutableBuffer * |
| 481 | garrow_mutable_buffer_slice(GArrowMutableBuffer *buffer, gint64 offset, gint64 size) |
| 482 | { |
| 483 | auto arrow_parent_buffer = garrow_buffer_get_raw(GARROW_BUFFER(buffer)); |
| 484 | auto arrow_mutable_buffer = |
| 485 | std::make_shared<arrow::MutableBuffer>(arrow_parent_buffer, offset, size); |
| 486 | auto arrow_buffer = std::static_pointer_cast<arrow::Buffer>(arrow_mutable_buffer); |
| 487 | auto sliced_buffer = garrow_buffer_new_raw_parent(&arrow_buffer, GARROW_BUFFER(buffer)); |
| 488 | return GARROW_MUTABLE_BUFFER(sliced_buffer); |
| 489 | } |
| 490 | |
| 491 | /** |
| 492 | * garrow_mutable_buffer_set_data: |
nothing calls this directly
no test coverage detected