|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mmtk.vm.gcspy.Util
public abstract class Util
Abstract class that provides generally useful methods.
Constructor Summary | |
---|---|
Util()
|
Method Summary | |
---|---|
abstract Object |
createDataArray(Object templ,
int numElements)
Create an array of a particular type. |
static void |
dumpRange(Address start,
Address end)
Dump a range in format [start,end) |
abstract void |
formatSize(Address buffer,
int size)
Pretty print a size, converting from bytes to kilo- or mega-bytes as appropriate |
abstract Address |
formatSize(String format,
int bufsize,
int size)
Pretty print a size, converting from bytes to kilo- or mega-bytes as appropriate |
abstract void |
free(Address addr)
Free an array of bytes previously allocated with malloc |
abstract Address |
getBytes(String str)
Convert a String to a 0-terminated array of bytes |
abstract Address |
malloc(int size)
Allocate an array of bytes with malloc |
static int |
numToBytes(byte[] buffer,
long value)
Place a string representation of a long in an array of bytes without incurring allocation |
static int |
numToBytes(byte[] buffer,
long value,
int radix)
Place a string representation of a long in an array of bytes without incurring allocation |
abstract int |
sprintf(Address str,
Address format,
Address value)
sprintf(char *str, char *format, char* value) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Util()
Method Detail |
---|
public abstract Address malloc(int size)
size
- The size to allocate
free(org.vmmagic.unboxed.Address)
public abstract void free(Address addr)
addr
- The address of some memory previously allocated with mallocmalloc(int)
public static void dumpRange(Address start, Address end)
start
- The start of the rangeend
- The end of the rangepublic abstract Address getBytes(String str)
str
- The string to convert
public abstract void formatSize(Address buffer, int size)
buffer
- The buffer (in C space) in which to place the formatted sizesize
- The size in bytespublic abstract Address formatSize(String format, int bufsize, int size)
format
- A format stringbufsize
- The size of a buffer large enough to hold the formatted resultsize
- The size in bytespublic static int numToBytes(byte[] buffer, long value)
buffer
- The byte arrayvalue
- The long to convert
public static int numToBytes(byte[] buffer, long value, int radix)
buffer
- The byte arrayvalue
- The long to convertradix
- the base to use for conversion
public abstract int sprintf(Address str, Address format, Address value)
sprintf(char *str, char *format, char* value)
str
- The destination 'string' (memory in C space)format
- The format 'string' (memory in C space)value
- The value 'string' (memory in C space)
public abstract Object createDataArray(Object templ, int numElements)
Foo[] x = (Foo [])Stream.createDataArray(new Foo[0], numElements);
templ
- a data array to use as a templatenumElements
- number of elements in new array
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |