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

Function primitive_array_get

ruby/red-arrow/ext/arrow/memory-view.cpp:219–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217 };
218
219 bool primitive_array_get(VALUE obj, rb_memory_view_t *view, int flags) {
220 if (flags != RUBY_MEMORY_VIEW_SIMPLE) {
221 return false;
222 }
223 auto view_ = reinterpret_cast<memory_view *>(view);
224 memset(view_, 0, sizeof(memory_view));
225 view_->obj = obj;
226 view_->private_data = new PrivateData();
227 auto array = GARROW_ARRAY(RVAL2GOBJ(obj));
228 auto arrow_array = garrow_array_get_raw(array);
229 PrimitiveArrayGetter getter(view_);
230 auto status = arrow_array->Accept(&getter);
231 if (!status.ok()) {
232 return false;
233 }
234 view_->readonly = true;
235 view_->ndim = 1;
236 return true;
237 }
238
239 bool primitive_array_release(VALUE obj, rb_memory_view_t *view) {
240 auto view_ = reinterpret_cast<memory_view *>(view);

Callers

nothing calls this directly

Calls 3

garrow_array_get_rawFunction · 0.50
AcceptMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected