org.jruby.ext.ffi.jffi
Class Factory
java.lang.Object
org.jruby.ext.ffi.Factory
org.jruby.ext.ffi.jffi.Factory
public class Factory
- extends Factory
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Factory
public Factory()
init
public void init(Ruby runtime,
RubyModule ffi)
- Description copied from class:
Factory
- Registers FFI ruby classes/modules
- Overrides:
init
in class Factory
allocateDirectMemory
public AllocatedDirectMemoryIO allocateDirectMemory(Ruby runtime,
int size,
boolean clear)
- Allocates memory on the native C heap and wraps it in a MemoryIO accessor.
- Specified by:
allocateDirectMemory
in class Factory
- Parameters:
size
- The number of bytes to allocate.clear
- If the memory should be cleared.
- Returns:
- A new MemoryIO.
allocateDirectMemory
public AllocatedDirectMemoryIO allocateDirectMemory(Ruby runtime,
int size,
int align,
boolean clear)
- Allocates memory on the native C heap and wraps it in a MemoryIO accessor.
- Specified by:
allocateDirectMemory
in class Factory
- Parameters:
size
- The number of bytes to allocate.align
- The minimum alignment of the memoryclear
- If the memory should be cleared.
- Returns:
- A new MemoryIO.
wrapDirectMemory
public DirectMemoryIO wrapDirectMemory(Ruby runtime,
long address)
- Description copied from class:
Factory
- Wraps a native C memory address in a MemoryIO accessor.
- Specified by:
wrapDirectMemory
in class Factory
address
- The native address to wrap.
- Returns:
- A new MemoryIO.
newFunction
public Function newFunction(Ruby runtime,
Pointer address,
CallbackInfo cbInfo)
- Specified by:
newFunction
in class Factory
getCallbackManager
public CallbackManager getCallbackManager()
- Specified by:
getCallbackManager
in class Factory
sizeOf
public int sizeOf(NativeType type)
- Specified by:
sizeOf
in class Factory
alignmentOf
public int alignmentOf(NativeType type)
- Specified by:
alignmentOf
in class Factory
Copyright © 2002-2009 JRuby Team. All Rights Reserved.