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

Function garrow_buffer_get_mutable_data

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

* garrow_buffer_get_mutable_data: * @buffer: A #GArrowBuffer. * * Returns: (transfer full) (nullable): The data of the buffer. If the * buffer is immutable, it returns %NULL. The data is owned by the * buffer. You should not free the data. * * Since: 0.3.0 */

Source from the content-addressed store, hash-verified

311 * Since: 0.3.0
312 */
313GBytes *
314garrow_buffer_get_mutable_data(GArrowBuffer *buffer)
315{
316 auto arrow_buffer = garrow_buffer_get_raw(buffer);
317 if (!arrow_buffer->is_mutable()) {
318 return NULL;
319 }
320
321 auto priv = GARROW_BUFFER_GET_PRIVATE(buffer);
322 if (priv->data) {
323 g_bytes_ref(priv->data);
324 return priv->data;
325 }
326
327 return g_bytes_new_static(arrow_buffer->mutable_data(), arrow_buffer->size());
328}
329
330/**
331 * garrow_buffer_get_size:

Callers

nothing calls this directly

Calls 3

garrow_buffer_get_rawFunction · 0.85
mutable_dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected