FFI::ClangSourceFFIClangTokenOwner

class Owner

Owns a single libclang token buffer and disposes it when no longer referenced.

Definitions

def initialize(pointer, translation_unit)

Wrap the token pointer with the metadata needed by clang_disposeTokens.

Signature

parameter pointer FFI::Pointer

The libclang token buffer.

parameter translation_unit TranslationUnit

The translation unit that owns the token.

Implementation

def initialize(pointer, translation_unit)
	super Lib::TokensPointer.new(pointer, 1, translation_unit)
end

def self.release(pointer)

Release the token buffer.

Signature

parameter pointer Lib::TokensPointer

The token pointer to release.

Implementation

def self.release(pointer)
	Lib.dispose_tokens(pointer.translation_unit, pointer, pointer.token_size)
end