Class: Groonga::MemoryPool Private

Inherits:
Object
  • Object
show all
Defined in:
lib/groonga/memory-pool.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initializeMemoryPool

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of MemoryPool



21
22
23
# File 'lib/groonga/memory-pool.rb', line 21

def initialize
  @temporary_objects = {}
end

Instance Method Details

#closeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



30
31
32
33
34
35
# File 'lib/groonga/memory-pool.rb', line 30

def close
  @temporary_objects.each do |(object, _)|
    object.close unless object.closed?
  end
  @temporary_objects.clear
end

#register(object) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



25
26
27
28
# File 'lib/groonga/memory-pool.rb', line 25

def register(object)
  return unless object.temporary?
  @temporary_objects[object] = true
end