Top Description Fields Constructors Methods
org.lwjgl.system

pack-priv final Class MemoryAccessJNI

extends Object
Class Inheritance
Static Imports
org.lwjgl.system.Checks.*

Memory access utilities.

Field Summary

Modifier and TypeField and Description
pack-priv static final long
aligned_alloc

Returns the address of the stdlib aligned_alloc function.

pack-priv static final long
aligned_free

Returns the address of the stdlib aligned_free function.

pack-priv static final long
calloc

Returns the address of the stdlib calloc function.

pack-priv static final long
free

Returns the address of the stdlib free function.

pack-priv static final long
malloc

Returns the address of the stdlib malloc function.

pack-priv static final long
realloc

Returns the address of the stdlib realloc function.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static native long
private static native long
private static native long
private static native long
free()

pack-priv static long
getAddress(long
the memory address to read
ptr
)

Reads a pointer address from the specified memory address.

pack-priv static byte
getByte(long
the memory address to read
ptr
)

Reads a byte value from the specified memory address.

pack-priv static double
getDouble(long
the memory address to read
ptr
)

Reads a double value from the specified memory address.

pack-priv static float
getFloat(long
the memory address to read
ptr
)

Reads a float value from the specified memory address.

pack-priv static int
getInt(long
the memory address to read
ptr
)

Reads an int value from the specified memory address.

pack-priv static long
getLong(long
the memory address to read
ptr
)

Reads a long value from the specified memory address.

pack-priv static native int
getPointerSize()

Returns the sizeof(void *).

pack-priv static short
getShort(long
the memory address to read
ptr
)

Reads a short value from the specified memory address.

private static native long
pack-priv static native long
ngetAddress(long ptr)

Unsafe version of: getAddress

pack-priv static native byte
ngetByte(long ptr)

Unsafe version of: getByte

pack-priv static native double
ngetDouble(long ptr)

Unsafe version of: getDouble

pack-priv static native float
ngetFloat(long ptr)

Unsafe version of: getFloat

pack-priv static native int
ngetInt(long ptr)

Unsafe version of: getInt

pack-priv static native long
ngetLong(long ptr)

Unsafe version of: getLong

pack-priv static native short
ngetShort(long ptr)

Unsafe version of: getShort

pack-priv static native void
nputAddress(long ptr, long value)

Unsafe version of: putAddress

pack-priv static native void
nputByte(long ptr, byte value)

Unsafe version of: putByte

pack-priv static native void
nputDouble(long ptr, double value)

Unsafe version of: putDouble

pack-priv static native void
nputFloat(long ptr, float value)

Unsafe version of: putFloat

pack-priv static native void
nputInt(long ptr, int value)

Unsafe version of: putInt

pack-priv static native void
nputLong(long ptr, long value)

Unsafe version of: putLong

pack-priv static native void
nputShort(long ptr, short value)

Unsafe version of: putShort

pack-priv static void
putAddress(long
the memory address to write
ptr
,
long
the value to write
value
)

Writes a pointer address to the specified memory address.

pack-priv static void
putByte(long
the memory address to write
ptr
,
byte
the value to write
value
)

Writes a byte value to the specified memory address.

pack-priv static void
putDouble(long
the memory address to write
ptr
,
double
the value to write
value
)

Writes a double value to the specified memory address.

pack-priv static void
putFloat(long
the memory address to write
ptr
,
float
the value to write
value
)

Writes a float value to the specified memory address.

pack-priv static void
putInt(long
the memory address to write
ptr
,
int
the value to write
value
)

Writes an int value to the specified memory address.

pack-priv static void
putLong(long
the memory address to write
ptr
,
long
the value to write
value
)

Writes a long value to the specified memory address.

pack-priv static void
putShort(long
the memory address to write
ptr
,
short
the value to write
value
)

Writes a short value to the specified memory address.

private static native long
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aligned_allocback to summary
pack-priv static final long aligned_alloc

Returns the address of the stdlib aligned_alloc function.

aligned_freeback to summary
pack-priv static final long aligned_free

Returns the address of the stdlib aligned_free function.

callocback to summary
pack-priv static final long calloc

Returns the address of the stdlib calloc function.

freeback to summary
pack-priv static final long free

Returns the address of the stdlib free function.

mallocback to summary
pack-priv static final long malloc

Returns the address of the stdlib malloc function.

reallocback to summary
pack-priv static final long realloc

Returns the address of the stdlib realloc function.

Constructor Detail

MemoryAccessJNIback to summary
private MemoryAccessJNI()

Method Detail

aligned_allocback to summary
private static native long aligned_alloc()
Annotations
@NativeType:void * (*) (size_t, size_t)
aligned_freeback to summary
private static native long aligned_free()
Annotations
@NativeType:void (*) (void *)
callocback to summary
private static native long calloc()
Annotations
@NativeType:void * (*) (size_t, size_t)
freeback to summary
private static native long free()
Annotations
@NativeType:void (*) (void *)
getAddressback to summary
pack-priv static long getAddress(long ptr)

Reads a pointer address from the specified memory address.

Parameters
ptr:long

the memory address to read

Annotations
@NativeType:uintptr_t
getByteback to summary
pack-priv static byte getByte(long ptr)

Reads a byte value from the specified memory address.

Parameters
ptr:long

the memory address to read

Annotations
@NativeType:int8_t
getDoubleback to summary
pack-priv static double getDouble(long ptr)

Reads a double value from the specified memory address.

Parameters
ptr:long

the memory address to read

getFloatback to summary
pack-priv static float getFloat(long ptr)

Reads a float value from the specified memory address.

Parameters
ptr:long

the memory address to read

getIntback to summary
pack-priv static int getInt(long ptr)

Reads an int value from the specified memory address.

Parameters
ptr:long

the memory address to read

Annotations
@NativeType:int32_t
getLongback to summary
pack-priv static long getLong(long ptr)

Reads a long value from the specified memory address.

Parameters
ptr:long

the memory address to read

Annotations
@NativeType:int64_t
getPointerSizeback to summary
pack-priv static native int getPointerSize()

Returns the sizeof(void *).

getShortback to summary
pack-priv static short getShort(long ptr)

Reads a short value from the specified memory address.

Parameters
ptr:long

the memory address to read

Annotations
@NativeType:int16_t
mallocback to summary
private static native long malloc()
Annotations
@NativeType:void * (*) (size_t)
ngetAddressback to summary
pack-priv static native long ngetAddress(long ptr)

Unsafe version of: getAddress

ngetByteback to summary
pack-priv static native byte ngetByte(long ptr)

Unsafe version of: getByte

ngetDoubleback to summary
pack-priv static native double ngetDouble(long ptr)

Unsafe version of: getDouble

ngetFloatback to summary
pack-priv static native float ngetFloat(long ptr)

Unsafe version of: getFloat

ngetIntback to summary
pack-priv static native int ngetInt(long ptr)

Unsafe version of: getInt

ngetLongback to summary
pack-priv static native long ngetLong(long ptr)

Unsafe version of: getLong

ngetShortback to summary
pack-priv static native short ngetShort(long ptr)

Unsafe version of: getShort

nputAddressback to summary
pack-priv static native void nputAddress(long ptr, long value)

Unsafe version of: putAddress

nputByteback to summary
pack-priv static native void nputByte(long ptr, byte value)

Unsafe version of: putByte

nputDoubleback to summary
pack-priv static native void nputDouble(long ptr, double value)

Unsafe version of: putDouble

nputFloatback to summary
pack-priv static native void nputFloat(long ptr, float value)

Unsafe version of: putFloat

nputIntback to summary
pack-priv static native void nputInt(long ptr, int value)

Unsafe version of: putInt

nputLongback to summary
pack-priv static native void nputLong(long ptr, long value)

Unsafe version of: putLong

nputShortback to summary
pack-priv static native void nputShort(long ptr, short value)

Unsafe version of: putShort

putAddressback to summary
pack-priv static void putAddress(long ptr, long value)

Writes a pointer address to the specified memory address.

Parameters
ptr:long

the memory address to write

value:long

the value to write

putByteback to summary
pack-priv static void putByte(long ptr, byte value)

Writes a byte value to the specified memory address.

Parameters
ptr:long

the memory address to write

value:byte

the value to write

putDoubleback to summary
pack-priv static void putDouble(long ptr, double value)

Writes a double value to the specified memory address.

Parameters
ptr:long

the memory address to write

value:double

the value to write

putFloatback to summary
pack-priv static void putFloat(long ptr, float value)

Writes a float value to the specified memory address.

Parameters
ptr:long

the memory address to write

value:float

the value to write

putIntback to summary
pack-priv static void putInt(long ptr, int value)

Writes an int value to the specified memory address.

Parameters
ptr:long

the memory address to write

value:int

the value to write

putLongback to summary
pack-priv static void putLong(long ptr, long value)

Writes a long value to the specified memory address.

Parameters
ptr:long

the memory address to write

value:long

the value to write

putShortback to summary
pack-priv static void putShort(long ptr, short value)

Writes a short value to the specified memory address.

Parameters
ptr:long

the memory address to write

value:short

the value to write

reallocback to summary
private static native long realloc()
Annotations
@NativeType:void * (*) (void *, size_t)