kou commented on code in PR #50234:
URL: https://github.com/apache/arrow/pull/50234#discussion_r3457461097
##########
ruby/red-arrow/test/test-memory-view.rb:
##########
@@ -431,4 +431,55 @@ def little_endian?
])
end
end
+
+ sub_test_case("uninitialized rb_memory_view_t") do
+ def setup
+ libruby = Fiddle.dlopen(nil)
+
+ @rb_memory_view_get = Fiddle::Function.new(
+ libruby["rb_memory_view_get"],
+ [
+ Fiddle::TYPE_UINTPTR_T,
+ Fiddle::TYPE_VOIDP,
+ Fiddle::TYPE_INT,
+ ],
+ Fiddle::TYPE_BOOL
+ )
+
+ @rb_memory_view_release = Fiddle::Function.new(
+ libruby["rb_memory_view_release"],
+ [
+ Fiddle::TYPE_VOIDP,
+ ],
+ Fiddle::TYPE_BOOL
+ )
+ end
+
+ def assert_release(target)
+ size = 256 # We should use sizeof(rb_memory_view_t) but it isn't
available from Ruby.
Review Comment:
```suggestion
# We should use sizeof(rb_memory_view_t) but it isn't available from
Ruby.
# 256 must be larger than sizeof(rb_memory_view_t).
size = 256
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]