class YARP::LibRubyParser::YPBuffer

def self.with(&block)

automatically freed when the block returns.
Initialize a new buffer and yield it to the block. The buffer will be
def self.with(&block)
  pointer = FFI::MemoryPointer.new(SIZEOF)
  begin
    raise unless LibRubyParser.yp_buffer_init(pointer)
    yield new(pointer)
  ensure
    LibRubyParser.yp_buffer_free(pointer)
    pointer.free
  end
end