File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -256,9 +256,19 @@ def to_ptr
256
256
@pointer
257
257
end
258
258
259
- # For interop TO_NATIVE
259
+ # Every IS_POINTER object should also have TO_NATIVE
260
260
def to_native
261
- @pointer
261
+ self
262
+ end
263
+
264
+ # For NFI, to implement IS_POINTER
265
+ def pointer?
266
+ true
267
+ end
268
+
269
+ # For NFI, to implement AS_POINTER
270
+ def address
271
+ @pointer . address
262
272
end
263
273
264
274
def free
Original file line number Diff line number Diff line change @@ -78,11 +78,6 @@ def initialize_copy(other)
78
78
end
79
79
end
80
80
81
- # For interop TO_NATIVE
82
- def to_native
83
- @pointer
84
- end
85
-
86
81
private def pointer = ( pointer )
87
82
unless FFI ::AbstractMemory === pointer
88
83
raise TypeError , "wrong argument type #{ pointer . class } (expected Pointer or Buffer)"
You can’t perform that action at this time.
0 commit comments