Package org.jruby.ext.ffi.jffi
Class Factory
java.lang.Object
org.jruby.ext.ffi.Factory
org.jruby.ext.ffi.jffi.Factory
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintalignmentOf(NativeType type) allocateDirectMemory(Ruby runtime, int size, boolean clear) Allocates memory on the native C heap and wraps it in aMemoryIOaccessor.allocateDirectMemory(Ruby runtime, int size, int align, boolean clear) Allocates memory on the native C heap and wraps it in aMemoryIOaccessor.allocateTransientDirectMemory(Ruby runtime, int size, int align, boolean clear) Allocates transient native memory (not from C heap) and wraps it in aMemoryIOaccessor.voidinit(Ruby runtime, RubyModule FFI) Registers FFI ruby classes/modulesnewFunction(Ruby runtime, Pointer address, CallbackInfo cbInfo) intsizeOf(NativeType type) wrapDirectMemory(Ruby runtime, long address) Wraps a native C memory address in aMemoryIOaccessor.Methods inherited from class org.jruby.ext.ffi.Factory
getInstance
-
Constructor Details
-
Factory
public Factory()
-
-
Method Details
-
init
Description copied from class:FactoryRegisters FFI ruby classes/modules -
allocateDirectMemory
Allocates memory on the native C heap and wraps it in aMemoryIOaccessor.- Specified by:
allocateDirectMemoryin classFactory- Parameters:
size- The number of bytes to allocate.clear- If the memory should be cleared.- Returns:
- A new
MemoryIO.
-
allocateDirectMemory
Allocates memory on the native C heap and wraps it in aMemoryIOaccessor.- Specified by:
allocateDirectMemoryin classFactory- 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.
-
allocateTransientDirectMemory
Description copied from class:FactoryAllocates transient native memory (not from C heap) and wraps it in aMemoryIOaccessor.- Specified by:
allocateTransientDirectMemoryin classFactory- Parameters:
size- The number of bytes to allocate.align- The minimum alignment of the memoryclear- If the memory should be cleared.- Returns:
- A new
AllocatedDirectMemoryIO.
-
wrapDirectMemory
Description copied from class:FactoryWraps a native C memory address in aMemoryIOaccessor.- Specified by:
wrapDirectMemoryin classFactory- Parameters:
address- The native address to wrap.- Returns:
- A new
MemoryIO.
-
newFunction
- Specified by:
newFunctionin classFactory
-
getCallbackManager
- Specified by:
getCallbackManagerin classFactory
-
sizeOf
-
alignmentOf
- Specified by:
alignmentOfin classFactory
-