Top Description Fields Constructors Methods
org.jruby.ext.ffi

public Class NoImplFactory

extends Factory
Class Inheritance
Imports
org.jruby.Ruby, .RubyModule

An instance of Factory that is used when no FFI implementation can be found.

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
public MemoryIO
allocateDirectMemory(Ruby runtime, int
The number of bytes to allocate.
size
,
boolean
If the memory should be cleared.
clear
)

Implements abstract org.jruby.ext.ffi.Factory.allocateDirectMemory.

Allocates memory on the native C heap and wraps it in a MemoryIO accessor.

public MemoryIO
allocateDirectMemory(Ruby runtime, int
The number of bytes to allocate.
size
,
int
The minimum alignment of the memory
align
,
boolean
If the memory should be cleared.
clear
)

Implements abstract org.jruby.ext.ffi.Factory.allocateDirectMemory.

Allocates memory on the native C heap and wraps it in a MemoryIO accessor.

public MemoryIO
allocateTransientDirectMemory(Ruby runtime, int
The number of bytes to allocate.
size
,
int
The minimum alignment of the memory
align
,
boolean
If the memory should be cleared.
clear
)

Implements abstract org.jruby.ext.ffi.Factory.allocateTransientDirectMemory.

Allocates transient native memory (not from C heap) and wraps it in a MemoryIO accessor.

public CallbackManager
public void
init(Ruby
The ruby runtime
runtime
,
RubyModule
the module to register the classes under
ffi
)

Overrides org.jruby.ext.ffi.Factory.init.

Registers FFI ruby classes/modules

public AbstractInvoker
newFunction(Ruby runtime, Pointer address, CallbackInfo cbInfo)

Implements abstract org.jruby.ext.ffi.Factory.newFunction.

public int
public MemoryIO
wrapDirectMemory(Ruby runtime, long
The native address to wrap.
address
)

Implements abstract org.jruby.ext.ffi.Factory.wrapDirectMemory.

Wraps a native C memory address in a MemoryIO accessor.

Inherited from org.jruby.ext.ffi.Factory:
getInstance

Field Detail

msgback to summary
private final String msg

Constructor Detail

NoImplFactoryback to summary
public NoImplFactory(String msg)

Method Detail

alignmentOfback to summary
public int alignmentOf(NativeType type)

Implements abstract org.jruby.ext.ffi.Factory.alignmentOf.

Annotations
@Override
allocateDirectMemoryback to summary
public MemoryIO allocateDirectMemory(Ruby runtime, int size, boolean clear)

Implements abstract org.jruby.ext.ffi.Factory.allocateDirectMemory.

Doc from org.jruby.ext.ffi.Factory.allocateDirectMemory.

Allocates memory on the native C heap and wraps it in a MemoryIO accessor.

Parameters
size:int

The number of bytes to allocate.

clear:boolean

If the memory should be cleared.

Returns:MemoryIO

A new AllocatedDirectMemoryIO.

Annotations
@Override
allocateDirectMemoryback to summary
public MemoryIO allocateDirectMemory(Ruby runtime, int size, int align, boolean clear)

Implements abstract org.jruby.ext.ffi.Factory.allocateDirectMemory.

Doc from org.jruby.ext.ffi.Factory.allocateDirectMemory.

Allocates memory on the native C heap and wraps it in a MemoryIO accessor.

Parameters
size:int

The number of bytes to allocate.

align:int

The minimum alignment of the memory

clear:boolean

If the memory should be cleared.

Returns:MemoryIO

A new AllocatedDirectMemoryIO.

Annotations
@Override
allocateTransientDirectMemoryback to summary
public MemoryIO allocateTransientDirectMemory(Ruby runtime, int size, int align, boolean clear)

Implements abstract org.jruby.ext.ffi.Factory.allocateTransientDirectMemory.

Doc from org.jruby.ext.ffi.Factory.allocateTransientDirectMemory.

Allocates transient native memory (not from C heap) and wraps it in a MemoryIO accessor.

Parameters
size:int

The number of bytes to allocate.

align:int

The minimum alignment of the memory

clear:boolean

If the memory should be cleared.

Returns:MemoryIO

A new AllocatedDirectMemoryIO.

Annotations
@Override
getCallbackManagerback to summary
public CallbackManager getCallbackManager()

Implements abstract org.jruby.ext.ffi.Factory.getCallbackManager.

Annotations
@Override
initback to summary
public void init(Ruby runtime, RubyModule ffi)

Overrides org.jruby.ext.ffi.Factory.init.

Doc from org.jruby.ext.ffi.Factory.init.

Registers FFI ruby classes/modules

Parameters
runtime:Ruby

The ruby runtime

ffi:RubyModule

the module to register the classes under

Annotations
@Override
newFunctionback to summary
public AbstractInvoker newFunction(Ruby runtime, Pointer address, CallbackInfo cbInfo)

Implements abstract org.jruby.ext.ffi.Factory.newFunction.

Annotations
@Override
sizeOfback to summary
public int sizeOf(NativeType type)

Implements abstract org.jruby.ext.ffi.Factory.sizeOf.

Annotations
@Override
wrapDirectMemoryback to summary
public MemoryIO wrapDirectMemory(Ruby runtime, long address)

Implements abstract org.jruby.ext.ffi.Factory.wrapDirectMemory.

Doc from org.jruby.ext.ffi.Factory.wrapDirectMemory.

Wraps a native C memory address in a MemoryIO accessor.

Parameters
address:long

The native address to wrap.

Returns:MemoryIO

A new MemoryIO.

Annotations
@Override