Skip to content

Commit ed1078c

Browse files
committed
[GR-18163] FFI: Allow type retrieval of attached functions and global variables (#3055)
PullRequest: truffleruby/3825
2 parents c8a6b3d + c0c2ed5 commit ed1078c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lib/truffle/truffle/ffi_backend/function.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ def free
137137
@native_wrapper = nil
138138
end
139139

140+
private def type
141+
@function_info
142+
end
143+
140144
private def convert_ruby_to_native(type, value, enums)
141145
if Primitive.is_a?(type, FFI::Type::Mapped)
142146
type.to_native(value, nil)
@@ -207,6 +211,8 @@ def free
207211
end
208212

209213
class VariadicInvoker
214+
attr_reader :return_type
215+
210216
def initialize(function, args_types, return_type, options)
211217
@function = function
212218
@return_type = return_type

lib/truffle/truffle/ffi_backend/type.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def inspect
112112

113113
class Mapped < Type
114114
attr_reader :native_type
115+
attr_reader :converter
115116
alias_method :type, :native_type
116117

117118
def initialize(converter)

0 commit comments

Comments
 (0)