| org.apache.harmony.luni.platform.IMemorySystem
All known Subclasses: org.apache.harmony.luni.platform.OSMemory,
IMemorySystem | public interface IMemorySystem (Code) | | IMemorySystem
|
Method Summary | |
public void | flush(long addr, long size) | public void | free(long address) Deallocates space for a memory block that was previously allocated by a
call to
IMemorySystem.malloc(long) malloc(long) . | public long | getAddress(long address) Gets the value of the platform pointer at the given address.
The length of the platform pointer is defined by
POINTER_SIZE .
The behavior is unspecified if
(address ... | public byte | getByte(long address) | public void | getByteArray(long address, byte[] bytes, int offset, int length) Copies length bytes from the memory block at
address into the byte array bytes starting
at element offset within the byte array.
The behavior of this method is undefined if the range
(address ... | public double | getDouble(long address) Gets the value of the IEEE754-format eight-byte float stored in platform
byte order at the given address.
The behavior is unspecified if (address ... | public double | getDouble(long address, Endianness endianness) | public float | getFloat(long address) Gets the value of the IEEE754-format four-byte float stored in platform
byte order at the given address.
The behavior is unspecified if (address ... | public float | getFloat(long address, Endianness endianness) | public int | getInt(long address) Gets the value of the signed four-byte integer stored in platform
byte-order at the given address.
The behavior is unspecified if (address ... | public int | getInt(long address, Endianness endianness) | public long | getLong(long address) Gets the value of the signed eight-byte integer stored in platform byte
order at the given address.
The behavior is unspecified if (address ... | public long | getLong(long address, Endianness endianness) | public int | getPointerSize() Answers the platform pointer size. | public short | getShort(long address) Gets the value of the signed two-byte integer stored in platform byte
order at the given address.
The behavior is unspecified if (address ... | public short | getShort(long address, Endianness endianness) | public boolean | isLittleEndian() Answers true if the platform is little endian, otherwise it may be
assumed to be big endian.. | public boolean | isLoaded(long addr, long size) | public void | load(long addr, long size) | public long | malloc(long length) Allocates and returns a pointer to space for a memory block of
length bytes. | public void | memmove(long destAddress, long srcAddress, long length) Copies length bytes from srcAddress to
destAddress . | public void | memset(long address, byte value, long length) Places value into first length bytes of the
memory block starting at address .
The behavior is unspecified if
(address ... | public long | mmap(long fileDescriptor, long alignment, long size, int mapMode) | public void | setAddress(long address, long value) Sets the value of the platform pointer at the given address.
The length of the platform pointer is defined by
POINTER_SIZE . | public void | setByte(long address, byte value) Sets the given single byte value at the given address. | public void | setByteArray(long address, byte[] bytes, int offset, int length) Copies length bytes from the byte array bytes
into the memory block at address , starting at element
offset within the byte array.
The behavior of this method is undefined if the range
(address ... | public void | setDouble(long address, double value) Sets the value of the IEEE754-format eight-byte float store in platform
byte order at the given address.
The behavior is unspecified if (address ... | public void | setDouble(long address, double value, Endianness endianness) | public void | setFloat(long address, float value) Sets the value of the IEEE754-format four-byte float stored in platform
byte order at the given address.
The behavior is unspecified if (address ... | public void | setFloat(long address, float value, Endianness endianness) | public void | setInt(long address, int value) Sets the value of the signed four-byte integer at the given address in
platform byte order.
The behavior is unspecified if (address ... | public void | setInt(long address, int value, Endianness endianness) | public void | setLong(long address, long value) Sets the value of the signed eight-byte integer at the given address in
the platform byte order.
The behavior is unspecified if (address ... | public void | setLong(long address, long value, Endianness endianness) | public void | setShort(long address, short value) Sets the value of the signed two-byte integer at the given address in
platform byte order.
The behavior is unspecified if (address ... | public void | setShort(long address, short value, Endianness endianness) | public void | unmap(long addr, long size) |
MMAP_READ_ONLY | final public int MMAP_READ_ONLY(Code) | | |
MMAP_READ_WRITE | final public int MMAP_READ_WRITE(Code) | | |
MMAP_WRITE_COPY | final public int MMAP_WRITE_COPY(Code) | | |
flush | public void flush(long addr, long size)(Code) | | TODO : JavaDoc
|
free | public void free(long address)(Code) | | Deallocates space for a memory block that was previously allocated by a
call to
IMemorySystem.malloc(long) malloc(long) . The number of bytes freed is
identical to the number of bytes acquired when the memory block was
allocated. If address is zero the method does nothing.
Freeing a pointer to a memory block that was not allocated by
malloc() has unspecified effect.
Parameters: address - the address of the memory block to deallocate. |
getAddress | public long getAddress(long address)(Code) | | Gets the value of the platform pointer at the given address.
The length of the platform pointer is defined by
POINTER_SIZE .
The behavior is unspecified if
(address ... address + POINTER_SIZE) is not wholly within
the range that was previously allocated using malloc() .
Parameters: address - the platform address of the start of the platform pointer. the value of the platform pointer as a Java long . |
getByte | public byte getByte(long address)(Code) | | |
getByteArray | public void getByteArray(long address, byte[] bytes, int offset, int length) throws NullPointerException, IndexOutOfBoundsException(Code) | | Copies length bytes from the memory block at
address into the byte array bytes starting
at element offset within the byte array.
The behavior of this method is undefined if the range
(address ... address + length) is not within a memory
block that was allocated using
IMemorySystem.malloc(long) malloc(long) .
Parameters: address - the address of the OS memory block from which to copy bytes. Parameters: bytes - the byte array into which to copy the bytes. Parameters: offset - the index of the first element in bytes thatwill be overwritten. Parameters: length - the total number of bytes to copy into the byte array. throws: NullPointerException - if bytes is null . throws: IndexOutOfBoundsException - if offset + length > bytes.length . |
getDouble | public double getDouble(long address)(Code) | | Gets the value of the IEEE754-format eight-byte float stored in platform
byte order at the given address.
The behavior is unspecified if (address ... address + 8)
is not wholly within the range that was previously allocated using
malloc() .
Parameters: address - the platform address of the start of the eight-byte value. the value of the eight-byte float as a Java double . |
getFloat | public float getFloat(long address)(Code) | | Gets the value of the IEEE754-format four-byte float stored in platform
byte order at the given address.
The behavior is unspecified if (address ... address + 4)
is not wholly within the range that was previously allocated using
malloc() .
Parameters: address - the platform address of the start of the eight-byte value. the value of the four-byte float as a Java float . |
getInt | public int getInt(long address)(Code) | | Gets the value of the signed four-byte integer stored in platform
byte-order at the given address.
The behavior is unspecified if (address ... address + 4)
is not wholly within the range that was previously allocated using
malloc() .
Parameters: address - the platform address of the start of the four-byte value. the value of the four-byte integer as a Java int . |
getLong | public long getLong(long address)(Code) | | Gets the value of the signed eight-byte integer stored in platform byte
order at the given address.
The behavior is unspecified if (address ... address + 8)
is not wholly within the range that was previously allocated using
malloc() .
Parameters: address - the platform address of the start of the eight-byte value. the value of the eight-byte integer as a Java long . |
getPointerSize | public int getPointerSize()(Code) | | Answers the platform pointer size.
the native platform pointer size, in bytes. |
getShort | public short getShort(long address)(Code) | | Gets the value of the signed two-byte integer stored in platform byte
order at the given address.
The behavior is unspecified if (address ... address + 2)
is not wholly within the range that was previously allocated using
malloc() .
Parameters: address - the platform address of the start of the two-byte value. the value of the two-byte integer as a Java short . |
isLittleEndian | public boolean isLittleEndian()(Code) | | Answers true if the platform is little endian, otherwise it may be
assumed to be big endian..
true if the platform is little endian. |
isLoaded | public boolean isLoaded(long addr, long size)(Code) | | TODO: JavaDoc
|
load | public void load(long addr, long size)(Code) | | TODO: JavaDoc
|
malloc | public long malloc(long length) throws OutOfMemoryError(Code) | | Allocates and returns a pointer to space for a memory block of
length bytes. The space is uninitialized and may be larger
than the number of bytes requested; however, the guaranteed usable memory
block is exactly length bytes long.
Parameters: length - number of bytes requested. the address of the start of the memory block. throws: OutOfMemoryError - if the request cannot be satisfied. |
memmove | public void memmove(long destAddress, long srcAddress, long length)(Code) | | Copies length bytes from srcAddress to
destAddress . Where any part of the source memory block
and the destination memory block overlap memmove() ensures
that the original source bytes in the overlapping region are copied
before being overwritten.
The behavior is unspecified if
(srcAddress ... srcAddress + length) and
(destAddress ... destAddress + length) are not both wholly
within the range that was previously allocated using
malloc() .
Parameters: destAddress - the address of the destination memory block. Parameters: srcAddress - the address of the source memory block. Parameters: length - the number of bytes to move. |
memset | public void memset(long address, byte value, long length)(Code) | | Places value into first length bytes of the
memory block starting at address .
The behavior is unspecified if
(address ... address + length) is not wholly within the
range that was previously allocated using malloc() .
Parameters: address - the address of the first memory location. Parameters: value - the byte value to set at each location. Parameters: length - the number of byte-length locations to set. |
mmap | public long mmap(long fileDescriptor, long alignment, long size, int mapMode) throws IOException(Code) | | TODO: JavaDoc
Parameters: fileDescriptor - Parameters: alignment - Parameters: size - Parameters: mapMode - throws: IOException - |
setAddress | public void setAddress(long address, long value)(Code) | | Sets the value of the platform pointer at the given address.
The length of the platform pointer is defined by
POINTER_SIZE . This method only sets
POINTER_SIZE bytes at the given address.
The behavior is unspecified if
(address ... address + POINTER_SIZE) is not wholly within
the range that was previously allocated using malloc() .
Parameters: address - the platform address of the start of the platform pointer. Parameters: value - the value of the platform pointer as a Java long . |
setByte | public void setByte(long address, byte value)(Code) | | Sets the given single byte value at the given address.
The behavior is unspecified if address is not in the range
that was previously allocated using malloc() .
Parameters: address - the address at which to set the byte value. Parameters: value - the value to set. |
setByteArray | public void setByteArray(long address, byte[] bytes, int offset, int length) throws NullPointerException, IndexOutOfBoundsException(Code) | | Copies length bytes from the byte array bytes
into the memory block at address , starting at element
offset within the byte array.
The behavior of this method is undefined if the range
(address ... address + length) is not within a memory
block that was allocated using
IMemorySystem.malloc(long) malloc(long) .
Parameters: address - the address of the OS memory block into which to copy thebytes. Parameters: bytes - the byte array from which to copy the bytes. Parameters: offset - the index of the first element in bytes thatwill be read. Parameters: length - the total number of bytes to copy from bytes into the memory block. throws: NullPointerException - if bytes is null . throws: IndexOutOfBoundsException - if offset + length > bytes.length . |
setDouble | public void setDouble(long address, double value)(Code) | | Sets the value of the IEEE754-format eight-byte float store in platform
byte order at the given address.
The behavior is unspecified if (address ... address + 8)
is not wholly within the range that was previously allocated using
malloc() .
Parameters: address - the platform address of the start of the eight-byte value. Parameters: value - the value of the eight-byte float as a Javadouble . |
setDouble | public void setDouble(long address, double value, Endianness endianness)(Code) | | |
setFloat | public void setFloat(long address, float value)(Code) | | Sets the value of the IEEE754-format four-byte float stored in platform
byte order at the given address.
The behavior is unspecified if (address ... address + 4)
is not wholly within the range that was previously allocated using
malloc() .
Parameters: address - the platform address of the start of the eight-byte value. Parameters: value - the value of the four-byte float as a Java float . |
setFloat | public void setFloat(long address, float value, Endianness endianness)(Code) | | |
setInt | public void setInt(long address, int value)(Code) | | Sets the value of the signed four-byte integer at the given address in
platform byte order.
The behavior is unspecified if (address ... address + 4)
is not wholly within the range that was previously allocated using
malloc() .
Parameters: address - the platform address of the start of the four-byte value. Parameters: value - the value of the four-byte integer as a Java int . |
setLong | public void setLong(long address, long value)(Code) | | Sets the value of the signed eight-byte integer at the given address in
the platform byte order.
The behavior is unspecified if (address ... address + 8)
is not wholly within the range that was previously allocated using
malloc() .
Parameters: address - the platform address of the start of the eight-byte value. Parameters: value - the value of the eight-byte integer as a Javalong . |
setLong | public void setLong(long address, long value, Endianness endianness)(Code) | | |
setShort | public void setShort(long address, short value)(Code) | | Sets the value of the signed two-byte integer at the given address in
platform byte order.
The behavior is unspecified if (address ... address + 2)
is not wholly within the range that was previously allocated using
malloc() .
Parameters: address - the platform address of the start of the two-byte value. Parameters: value - the value of the two-byte integer as a Java short . |
setShort | public void setShort(long address, short value, Endianness endianness)(Code) | | |
unmap | public void unmap(long addr, long size)(Code) | | TODO: JavaDoc
Parameters: addr - throws: IOException - |
|
|