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
Instance Attribute Summary collapse
-
#pinned_messages ⇒ Object
readonly
Returns the value of attribute pinned_messages.
Class Method Summary collapse
Instance Method Summary collapse
- #fuse(other_arena) ⇒ Object
-
#initialize(pointer) ⇒ Arena
constructor
A new instance of Arena.
- #pin(message) ⇒ Object
Methods included from TypeSafety
Constructor Details
Instance Attribute Details
#pinned_messages ⇒ Object (readonly)
Returns the value of attribute pinned_messages.
15 16 17 |
# File 'lib/google/protobuf/ffi/internal/arena.rb', line 15 def @pinned_messages end |
Class Method Details
.from_native(value, _) ⇒ Object
33 34 35 |
# File 'lib/google/protobuf/ffi/internal/arena.rb', line 33 def from_native(value, _) new(value) end |
.to_native(value, _) ⇒ Object
26 27 28 |
# File 'lib/google/protobuf/ffi/internal/arena.rb', line 26 def to_native(value, _) value.instance_variable_get(:@arena) || ::FFI::Pointer::NULL end |
Instance Method Details
#fuse(other_arena) ⇒ Object
43 44 45 46 47 48 |
# File 'lib/google/protobuf/ffi/internal/arena.rb', line 43 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 |
#pin(message) ⇒ Object
50 51 52 |
# File 'lib/google/protobuf/ffi/internal/arena.rb', line 50 def pin() .push end |