Class: Google::Protobuf::Internal::Arena
- Inherits:
-
Object
- Object
- Google::Protobuf::Internal::Arena
- Extended by:
- FFI::DataConverter, TypeSafety
- Defined in:
- lib/google/protobuf/ffi/internal/arena.rb
Class Method Summary collapse
Instance Method Summary collapse
- #fuse(other_arena) ⇒ Object
-
#initialize(pointer) ⇒ Arena
constructor
A new instance of Arena.
Methods included from TypeSafety
Constructor Details
Class Method Details
.from_native(value, _) ⇒ Object
31 32 33 |
# File 'lib/google/protobuf/ffi/internal/arena.rb', line 31 def from_native(value, _) new(value) end |
.to_native(value, _) ⇒ Object
24 25 26 |
# File 'lib/google/protobuf/ffi/internal/arena.rb', line 24 def to_native(value, _) value.instance_variable_get(:@arena) || ::FFI::Pointer::NULL end |
Instance Method Details
#fuse(other_arena) ⇒ Object
41 42 43 44 45 46 |
# File 'lib/google/protobuf/ffi/internal/arena.rb', line 41 def fuse(other_arena) return if other_arena == self unless Google::Protobuf::FFI.fuse_arena(self, other_arena) raise RuntimeError.new "Unable to fuse arenas. This should never happen since Ruby does not use initial blocks" end end |