In Files

  • dl/lib/dl/func.rb


Public Class Methods

new(cfunc, argtypes, n) click to toggle source
               # File dl/lib/dl/func.rb, line 221
def initialize(cfunc, argtypes, n)
  super(cfunc, argtypes)
  @carrier = []
  @index = n
  @mutex =

Public Instance Methods

bind_at_call(&block) click to toggle source
               # File dl/lib/dl/func.rb, line 236
def bind_at_call(&block)
  userdata = @carrier[-1]
    ptr = args[@index]
    if( !ptr )
      raise(RuntimeError, "The index of userdata should be lower than #{args.size}.")
    userdata = dlunwrap(Integer(ptr))
    args[@index] = userdata[1]
create_carrier(data) click to toggle source
               # File dl/lib/dl/func.rb, line 228
def create_carrier(data)
  ary = []
  userdata = [ary, data]
  return dlwrap(userdata)

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit

blog comments powered by Disqus