Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jruby.ext.ffi;
 
 import org.jruby.*;
 
 import java.util.Map;
The holder of all per-ruby-runtime FFI data
public class FFI {
    public final RubyModule ffiModule;
    public final RubyClass structClassfunctionClasscallbackClass;
    public final RubyClass typeClass;
    public final RubyHash typedefs;
    private final NullMemoryIO nullMemoryIO;
    private final TypeResolver typeResolver;
    
    
Reference map to keep libraries open for as long as there is a method mapped to that library.
    private final Map<DynamicMethodAbstractInvokerrefmap
            = Collections.synchronizedMap(new WeakHashMap<DynamicMethodAbstractInvoker>());
    public FFI(RubyModule ffiModule) {
        this. = ffiModule;
        this. = ffiModule.getClass("Buffer");
        this. = ffiModule.getClass("Pointer");
        this. = ffiModule.getClass("MemoryPointer");
        this. = ffiModule.getClass("AbstractMemory");
        this. = ffiModule.getClass("Struct");
        this. = ffiModule.getClass("Function");
        this. = ffiModule.getClass("Callback");
        this. = ffiModule.getClass("Type");
        this. = (RubyHashffiModule.getConstant("TypeDefs");
        this. = new TypeResolver(this);
        this. = new NullMemoryIO(ffiModule.getRuntime());
    }
    public final TypeResolver getTypeResolver() {
        return ;
    }
    public NullMemoryIO getNullMemoryIO() {
        return ;
    }
    public void registerAttachedMethod(DynamicMethod methodAbstractInvoker invoker) {
        .put(methodinvoker);
    }
New to GrepCode? Check out our FAQ X