Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jruby.ext.ffi.jffi;
 
 import org.jruby.Ruby;
Wrapper around the native callback, to represent it as a ruby object
@JRubyClass(name = "FFI::Callback", parent = "FFI::Pointer")
    final CallbackInfo cbInfo;
    NativeCallbackPointer(Ruby runtimeRubyClass klassClosure.Handle handleCallbackInfo cbInfoNativeFunctionInfo closureInfo) {
        super(runtimeklass,
                cbInfo.getParameterTypes().lengthnew CallbackMemoryIO(runtimehandle));
        this. = cbInfo;
        this. = closureInfo;
    }
    void dispose() {
        MemoryIO mem = getMemoryIO();
        if (mem instanceof CallbackMemoryIO) {
            ((CallbackMemoryIOmem).free();
        }
    }
    @Override
    public DynamicMethod createDynamicMethod(RubyModule module) {
        com.kenai.jffi.Function function = new com.kenai.jffi.Function(getMemoryIO().address(),
                ..);
        return MethodFactory.createDynamicMethod(getRuntime(), modulefunction,
                ...getRuntime().getNil(), false);
    }
New to GrepCode? Check out our FAQ X