You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/01/04 05:58:20 UTC

[GitHub] [arrow] kou commented on a change in pull request #12060: ARROW-15216: [GLib] Add Arrow::RoundToMultipleOptions

kou commented on a change in pull request #12060:
URL: https://github.com/apache/arrow/pull/12060#discussion_r777842469



##########
File path: c_glib/arrow-glib/compute.cpp
##########
@@ -3136,6 +3142,179 @@ garrow_round_options_new(void)
 }
 
 
+typedef struct GArrowRoundToMultipleOptionsPrivate_ {
+  GArrowScalar *multiple;
+} GArrowRoundToMultipleOptionsPrivate;
+
+enum {
+  PROP_ROUND_TO_MULTIPLE_OPTIONS_MULTIPLE = 1,
+  PROP_ROUND_TO_MULTIPLE_OPTIONS_MODE,
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE(GArrowRoundToMultipleOptions,
+                           garrow_round_to_multiple_options,
+                           GARROW_TYPE_FUNCTION_OPTIONS)

Review comment:
       You mean that why is `_WITH_PRIVATE` needed only for `GArrowRoundToMultipleOptions`, right?
   
   Because `arrow::compute::RoundToMultipleOptions` uses not only raw C types (`int64_t` and `enum`)  but also `struct`/`class` (`arrow::Scalar`). Apache Arrow GLib wraps `struct`/`class` by its Apache Arrow GLib type such as  `GArrowScalar` for `arrow::Scalar`. Apache Arrow GLib types use reference count based memory management by `g_object_ref()` and `g_object_unref()`. We need to keep a reference for Apache Arrow GLib object (`GArrowScalar`) that wraps Apache Arrow C++ object (`arrow::Scalar`) for memory management.
   
   Does this explanation answer your question?




-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org