|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.mmtk.vm.gcspy.Util
org.jikesrvm.mm.mmtk.gcspy.Util
public class Util
This class provides generally useful methods.
| Field Summary | |
|---|---|
private static boolean |
DEBUG_
|
static int |
KILOBYTE
|
static int |
MEGABYTE
|
| Constructor Summary | |
|---|---|
Util()
|
|
| Method Summary | |
|---|---|
Object |
createDataArray(Object templ,
int numElements)
Create an array of a particular type. |
void |
formatSize(Address buffer,
int size)
Pretty print a size, converting from bytes to kilo- or mega-bytes as appropriate |
Address |
formatSize(String format,
int bufsize,
int size)
Pretty print a size, converting from bytes to kilo- or mega-bytes as appropriate |
void |
free(Address addr)
Free an array of bytes previously allocated with malloc |
Address |
getBytes(String str)
Convert a String to a 0-terminated array of bytes |
Address |
malloc(int size)
Allocate an array of bytes with malloc |
int |
sprintf(Address str,
Address format,
Address value)
sprintf(char *str, char *format, char* value) |
| Methods inherited from class org.mmtk.vm.gcspy.Util |
|---|
dumpRange, numToBytes, numToBytes |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final boolean DEBUG_
public static final int KILOBYTE
public static final int MEGABYTE
| Constructor Detail |
|---|
public Util()
| Method Detail |
|---|
public final Address malloc(int size)
malloc in class Utilsize - The size to allocate
free(org.vmmagic.unboxed.Address)public final void free(Address addr)
free in class Utiladdr - The address of some memory previously allocated with mallocmalloc(int)public final Address getBytes(String str)
getBytes in class Utilstr - The string to convert
public final void formatSize(Address buffer,
int size)
formatSize in class Utilbuffer - The buffer (in C space) in which to place the formatted sizesize - The size in bytes
public final Address formatSize(String format,
int bufsize,
int size)
formatSize in class Utilformat - A format stringbufsize - The size of a buffer large enough to hold the formatted resultsize - The size in bytes
public Object createDataArray(Object templ,
int numElements)
createDataArray in class Utiltempl - a data array to use as a templatenumElements - number of elements in new array
public final int sprintf(Address str,
Address format,
Address value)
sprintf in class Utilstr - The destination 'string' (memory in C space)format - The format 'string' (memory in C space)value - The value 'string' (memory in C space)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||