MCPcopy Create free account
hub / github.com/apache/arrow / garrow_mutable_buffer_slice

Function garrow_mutable_buffer_slice

c_glib/arrow-glib/buffer.cpp:480–489  ·  view source on GitHub ↗

* 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

Source from the content-addressed store, hash-verified

478 * Since: 0.3.0
479 */
480GArrowMutableBuffer *
481garrow_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:

Callers

nothing calls this directly

Calls 2

garrow_buffer_get_rawFunction · 0.85

Tested by

no test coverage detected