Class: GSSAPI::LibGSSAPI::GssPointer

Inherits:
FFI::AutoPointer
  • Object
show all
Defined in:
lib/gssapi/lib_gssapi.rb

Overview

This s a generic AutoPointer. Gss pointers that implement this class should also implement a

class method called release_ptr that releases the structure pointed to by this pointer.

Direct Known Subclasses

GssCredIdT, GssCtxIdT, GssNameT

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.release(ptr) ⇒ Object


159
160
161
162
163
164
165
166
167
# File 'lib/gssapi/lib_gssapi.rb', line 159

def self.release(ptr)
  if( ptr.address == 0 )
    puts "Releasing #{self.name} NULL POINTER: Not freeing" if $DEBUG
    return
  else
    puts "Releasing #{self.name} at #{ptr.address.to_s(16)}" if $DEBUG
    self.release_ptr(ptr)
  end
end

Instance Method Details

#address_ofObject


154
155
156
157
# File 'lib/gssapi/lib_gssapi.rb', line 154

def address_of
  ptr_p = FFI::MemoryPointer.new :pointer
  ptr_p.write_pointer(self)
end