Package org.jruby.ext.ffi

Examples of org.jruby.ext.ffi.AbstractMemory


            if (!(parameter instanceof Struct)) {
                throw context.getRuntime().newTypeError("wrong argument type "
                        + parameter.getMetaClass().getName() + " (expected instance of FFI::Struct)");
            }

            final AbstractMemory memory = ((Struct) parameter).getMemory();
            if (memory.getSize() < layout.getSize()) {
                throw context.getRuntime().newArgumentError("struct memory too small for parameter");
            }

            final MemoryIO io = memory.getMemoryIO();
            if (io instanceof DirectMemoryIO) {
                if (io.isNull()) {
                    throw context.getRuntime().newRuntimeError("Cannot use a NULL pointer as a struct by value argument");
                }
                buffer.putStruct(((DirectMemoryIO) io).getAddress());
View Full Code Here


            if (!(parameter instanceof Struct)) {
                throw context.runtime.newTypeError("wrong argument type "
                        + parameter.getMetaClass().getName() + " (expected instance of FFI::Struct)");
            }

            final AbstractMemory memory = ((Struct) parameter).getMemory();
            if (memory.getSize() < layout.getSize()) {
                throw context.runtime.newArgumentError("struct memory too small for parameter");
            }

            final MemoryIO io = memory.getMemoryIO();
            if (io instanceof DirectMemoryIO) {
                if (io.isNull()) {
                    throw context.runtime.newRuntimeError("Cannot use a NULL pointer as a struct by value argument");
                }
                buffer.putStruct(((DirectMemoryIO) io).getAddress());
View Full Code Here

            if (!(parameter instanceof Struct)) {
                throw context.runtime.newTypeError("wrong argument type "
                        + parameter.getMetaClass().getName() + " (expected instance of FFI::Struct)");
            }

            final AbstractMemory memory = ((Struct) parameter).getMemory();
            if (memory.getSize() < layout.getSize()) {
                throw context.runtime.newArgumentError("struct memory too small for parameter");
            }

            final MemoryIO io = memory.getMemoryIO();
            if (io.isDirect()) {
                if (io.isNull()) {
                    throw context.runtime.newRuntimeError("Cannot use a NULL pointer as a struct by value argument");
                }
                buffer.putStruct(io.address());
View Full Code Here

TOP

Related Classes of org.jruby.ext.ffi.AbstractMemory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.