private static Type lookupAliasedType(jnr.ffi.Runtime runtime, Collection<Annotation> annotations) { for (Annotation a : annotations) { TypeDefinition typedef = a.annotationType().getAnnotation(TypeDefinition.class); if (typedef != null) { return runtime.findType(typedef.alias()); } } return null; }
private static Type lookupAliasedType(jnr.ffi.Runtime runtime, Collection<Annotation> annotations) { for (Annotation a : annotations) { TypeDefinition typedef = a.annotationType().getAnnotation(TypeDefinition.class); if (typedef != null) { return runtime.findType(typedef.alias()); } } return null; }
private static Type lookupAliasedType(jnr.ffi.Runtime runtime, Collection<Annotation> annotations) { for (Annotation a : annotations) { TypeDefinition typedef = a.annotationType().getAnnotation(TypeDefinition.class); if (typedef != null) { return runtime.findType(typedef.alias()); } } return null; }
/** * Gets the size of a Pointer in bits * * @return the size of the Pointer */ public final int size() { return getRuntime().findType(NativeType.ADDRESS).size() * 8; }
/** * Gets the size of a Pointer in bits * * @return the size of the Pointer */ public final int size() { return getRuntime().findType(NativeType.ADDRESS).size(); }
/** * Gets the size of a Pointer in bits * * @return the size of the Pointer */ public final int size() { return getRuntime().findType(NativeType.ADDRESS).size() * 8; }
/** * Gets the size of a Pointer in bits * * @return the size of the Pointer */ public final int size() { return getRuntime().findType(NativeType.ADDRESS).size(); }
/** * Gets the size of a Pointer in bits * * @return the size of the Pointer */ public final int size() { return getRuntime().findType(NativeType.ADDRESS).size(); }
/** * Gets the size of a Pointer in bits * * @return the size of the Pointer */ public final int size() { return getRuntime().findType(NativeType.ADDRESS).size() * 8; }
/** * Allocates a new block of native memory and wraps it in a {@link Pointer} * accessor. * * @param runtime The current runtime. * @param type The native type to allocate memory for. * * @return a {@code Pointer} instance that can access the memory. */ public static Pointer allocateDirect(Runtime runtime, NativeType type) { return runtime.getMemoryManager().allocateDirect(runtime.findType(type).size()); }
/** * Allocates a new block of java memory and wraps it in a {@link Pointer} * accessor. * * @param runtime The current runtime. * @param type The type alias to allocate memory for. * * @return a {@code Pointer} instance that can access the memory. */ public static Pointer allocate(Runtime runtime, TypeAlias type) { return runtime.getMemoryManager().allocate(runtime.findType(type).size()); }
/** * Allocates a new block of java memory and wraps it in a {@link Pointer} * accessor. * * @param runtime The current runtime. * @param type The native type to allocate memory for. * * @return a {@code Pointer} instance that can access the memory. */ public static Pointer allocate(Runtime runtime, NativeType type) { return runtime.getMemoryManager().allocate(runtime.findType(type).size()); }
/** * Allocates a new block of java memory and wraps it in a {@link Pointer} * accessor. * * @param type The native type to allocate memory for. * * @return a {@code Pointer} instance that can access the memory. */ public static Pointer allocate(Runtime runtime, NativeType type) { return runtime.getMemoryManager().allocate(runtime.findType(type).size()); }
/** * Allocates a new block of native memory and wraps it in a {@link Pointer} * accessor. * * @param runtime The current runtime. * @param type The type alias to allocate memory for. * * @return a {@code Pointer} instance that can access the memory. */ public static Pointer allocateDirect(Runtime runtime, TypeAlias type) { return runtime.getMemoryManager().allocateDirect(runtime.findType(type).size()); }
/** * Allocates a new block of native memory and wraps it in a {@link Pointer} * accessor. * * @param runtime The current runtime. * @param type The type alias to allocate memory for. * * @return a {@code Pointer} instance that can access the memory. */ public static Pointer allocateDirect(Runtime runtime, TypeAlias type) { return runtime.getMemoryManager().allocateDirect(runtime.findType(type).size()); }
/** * Allocates a new block of native memory and wraps it in a {@link Pointer} * accessor. * * @param runtime The current runtime. * @param type The native type to allocate memory for. * * @return a {@code Pointer} instance that can access the memory. */ public static Pointer allocateDirect(Runtime runtime, NativeType type) { return runtime.getMemoryManager().allocateDirect(runtime.findType(type).size()); }
/** * Allocates a new block of native memory and wraps it in a {@link Pointer} * accessor. * * @param type The type alias to allocate memory for. * * @return a {@code Pointer} instance that can access the memory. */ public static Pointer allocateDirect(Runtime runtime, TypeAlias type) { return runtime.getMemoryManager().allocateDirect(runtime.findType(type).size()); }
/** * Gets the value for this field. * * @return a int. */ public final long get(jnr.ffi.Pointer ptr) { long value = ptr.getNativeLong(offset()); final long mask = getRuntime().findType(NativeType.SLONG).size() == 4 ? 0xffffffffL : 0xffffffffffffffffL; return value < 0 ? (long) ((value & mask) + mask + 1) : value; }
/** * Gets the value for this field. * * @return a int. */ public final long get() { long value = getMemory().getNativeLong(offset()); final long mask = getRuntime().findType(NativeType.SLONG).size() == 32 ? 0xffffffffL : 0xffffffffffffffffL; return value < 0 ? (long) ((value & mask) + mask + 1) : value; }
/** * Gets the value for this field. * * @return a int. */ public final long get() { long value = getMemory().getNativeLong(offset()); final long mask = getRuntime().findType(NativeType.SLONG).size() == 32 ? 0xffffffffL : 0xffffffffffffffffL; return value < 0 ? (long) ((value & mask) + mask + 1) : value; }