public final class Memory extends Object
Modifier and Type | Method and Description |
---|---|
static Pointer |
allocate(Runtime runtime,
int size)
Allocates a new block of java memory and wraps it in a
Pointer
accessor. |
static Pointer |
allocate(Runtime runtime,
NativeType type)
Allocates a new block of java memory and wraps it in a
Pointer
accessor. |
static Pointer |
allocate(Runtime runtime,
Type type)
Allocates a new block of java memory and wraps it in a
Pointer
accessor. |
static Pointer |
allocate(Runtime runtime,
TypeAlias type)
Allocates a new block of java memory and wraps it in a
Pointer
accessor. |
static Pointer |
allocateDirect(Runtime runtime,
int size)
Allocates a new block of native memory and wraps it in a
Pointer
accessor. |
static Pointer |
allocateDirect(Runtime runtime,
int size,
boolean clear)
Allocates a new block of native memory and wraps it in a
Pointer
accessor. |
static Pointer |
allocateDirect(Runtime runtime,
NativeType type)
Allocates a new block of native memory and wraps it in a
Pointer
accessor. |
static Pointer |
allocateDirect(Runtime runtime,
TypeAlias type)
Allocates a new block of native memory and wraps it in a
Pointer
accessor. |
static Pointer |
allocateTemporary(Runtime runtime,
NativeType type)
Allocates a new block of transient native memory and wraps it in a
Pointer
accessor. |
static Pointer |
allocateTemporary(Runtime runtime,
NativeType type,
boolean clear)
Allocates a new block of transient native memory and wraps it in a
Pointer
accessor. |
static Pointer |
allocateTemporary(Runtime runtime,
TypeAlias type)
Allocates a new block of transient native memory and wraps it in a
Pointer
accessor. |
public static Pointer allocate(Runtime runtime, int size)
Pointer
accessor.runtime
- The current runtime.size
- The size in bytes of memory to allocate.Pointer
instance that can access the memory.public static Pointer allocate(Runtime runtime, NativeType type)
Pointer
accessor.runtime
- The current runtime.type
- The native type to allocate memory for.Pointer
instance that can access the memory.public static Pointer allocate(Runtime runtime, Type type)
Pointer
accessor.runtime
- The current runtime.type
- The type to allocate memory for.Pointer
instance that can access the memory.public static Pointer allocate(Runtime runtime, TypeAlias type)
Pointer
accessor.runtime
- The current runtime.type
- The type alias to allocate memory for.Pointer
instance that can access the memory.public static Pointer allocateDirect(Runtime runtime, int size)
Pointer
accessor.runtime
- The current runtime.size
- The size in bytes of memory to allocate.Pointer
instance that can access the memory.public static Pointer allocateDirect(Runtime runtime, NativeType type)
Pointer
accessor.runtime
- The current runtime.type
- The native type to allocate memory for.Pointer
instance that can access the memory.public static Pointer allocateDirect(Runtime runtime, TypeAlias type)
Pointer
accessor.runtime
- The current runtime.type
- The type alias to allocate memory for.Pointer
instance that can access the memory.public static Pointer allocateDirect(Runtime runtime, int size, boolean clear)
Pointer
accessor.runtime
- The current runtime.size
- The size in bytes of memory to allocate.clear
- Whether the memory contents should be cleared, or left as
random data.Pointer
instance that can access the memory.public static Pointer allocateTemporary(Runtime runtime, NativeType type)
Pointer
accessor. The memory returned by this method should not be passed to native methods
that store the address for later use, as it may change each time it is passed to native code.runtime
- The current runtime.type
- The native type to allocate memory for.Pointer
instance that can access the memory.public static Pointer allocateTemporary(Runtime runtime, TypeAlias type)
Pointer
accessor. The memory returned by this method should not be passed to native methods
that store the address for later use, as it may change each time it is passed to native code.runtime
- The current runtime.type
- The type alias to allocate memory for.Pointer
instance that can access the memory.public static Pointer allocateTemporary(Runtime runtime, NativeType type, boolean clear)
Pointer
accessor. The memory returned by this method should not be passed to native methods
that store the address for later use, as it may change each time it is passed to native code.runtime
- The current runtime.type
- The native type to allocate memory for.clear
- Whether the memory contents should be cleared, or left as
random data.Pointer
instance that can access the memory.Copyright © 2017. All rights reserved.