Class: Svn::Pool

Inherits:
FFI::AutoPointer
  • Object
show all
Defined in:
lib/svn/pools.rb

Overview

APR memory pool

Defined Under Namespace

Modules: C

Class Method Summary collapse

Class Method Details

.create(parent = nil) ⇒ Object

create a new pool in parent. if parent is nil, the allocate a root pool.



11
12
13
14
15
# File 'lib/svn/pools.rb', line 11

def create( parent=nil )
  out = FFI::MemoryPointer.new( :pointer )
  C.create( out, parent, C::RaiseOutOfMemory, nil )
  return new( out.read_pointer )
end

.release(ptr) ⇒ Object

free and release a pool



18
19
20
# File 'lib/svn/pools.rb', line 18

def release( ptr )
  C.destroy( ptr )
end