|
|||||||||
Home >> All >> [ Allocator overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |
Allocator
Class HeapAllocator

java.lang.ObjectAllocator.HeapAllocator
- All Implemented Interfaces:
- Clazz.jq_ClassFileConstants
- Direct Known Subclasses:
- SimpleAllocator
- public abstract class HeapAllocator
- extends java.lang.Object
- implements Clazz.jq_ClassFileConstants
- extends java.lang.Object
HeapAllocator
- Version:
- $Id: HeapAllocator.java,v 1.16 2003/05/12 10:04:52 joewhaley Exp $
Nested Class Summary | |
static class |
HeapAllocator.HeapPointer
An object of this class represents a pointer to a heap address. |
Field Summary | |
static Clazz.jq_StaticMethod |
_clsinitAndAllocateObject
|
private static boolean |
isOutOfMemory
|
private static java.lang.OutOfMemoryError |
outofmemoryerror
|
Constructor Summary | |
HeapAllocator()
|
Method Summary | |
abstract java.lang.Object |
allocateArray(int length,
int size,
java.lang.Object vtable)
Allocate an array with the default alignment. |
abstract java.lang.Object |
allocateArrayAlign8(int length,
int size,
java.lang.Object vtable)
Allocate an array such that the elements are 8-byte aligned. |
abstract java.lang.Object |
allocateObject(int size,
java.lang.Object vtable)
Allocate an object with the default alignment. |
abstract java.lang.Object |
allocateObjectAlign8(int size,
java.lang.Object vtable)
Allocate an object such that the first field is 8-byte aligned. |
static java.lang.Object |
clone(java.lang.Object o)
Clone the given object. |
static java.lang.Object |
clsinitAndAllocateObject(Clazz.jq_Type t)
Initialize class t and return a new uninitialized object of that type. |
abstract void |
collect()
Initiate a garbage collection. |
abstract int |
freeMemory()
Returns an estimate of the amount of free memory available. |
static void |
heapExhausted(Memory.Heap.Heap heap,
int size,
int count)
Handle heap exhaustion. |
abstract void |
init()
Perform initialization for this allocator. |
static void |
outOfMemory()
Called in an out of memory situation. |
abstract void |
processPtrField(Memory.Address a)
Process a reference to a heap object during garbage collection. |
abstract int |
totalMemory()
Returns an estimate of the total memory allocated (both used and unused). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
isOutOfMemory
private static boolean isOutOfMemory
outofmemoryerror
private static final java.lang.OutOfMemoryError outofmemoryerror
_clsinitAndAllocateObject
public static final Clazz.jq_StaticMethod _clsinitAndAllocateObject
Constructor Detail |
HeapAllocator
public HeapAllocator()
Method Detail |
init
public abstract void init() throws java.lang.OutOfMemoryError
- Perform initialization for this allocator. This will be called before any other methods.
allocateObject
public abstract java.lang.Object allocateObject(int size, java.lang.Object vtable) throws java.lang.OutOfMemoryError
- Allocate an object with the default alignment.
If the object cannot be allocated due to lack of memory, throws OutOfMemoryError.
allocateObjectAlign8
public abstract java.lang.Object allocateObjectAlign8(int size, java.lang.Object vtable) throws java.lang.OutOfMemoryError
- Allocate an object such that the first field is 8-byte aligned.
If the object cannot be allocated due to lack of memory, throws OutOfMemoryError.
allocateArray
public abstract java.lang.Object allocateArray(int length, int size, java.lang.Object vtable) throws java.lang.OutOfMemoryError, java.lang.NegativeArraySizeException
- Allocate an array with the default alignment.
If length is negative, throws NegativeArraySizeException.
If the array cannot be allocated due to lack of memory, throws OutOfMemoryError.
allocateArrayAlign8
public abstract java.lang.Object allocateArrayAlign8(int length, int size, java.lang.Object vtable) throws java.lang.OutOfMemoryError, java.lang.NegativeArraySizeException
- Allocate an array such that the elements are 8-byte aligned.
If length is negative, throws NegativeArraySizeException.
If the array cannot be allocated due to lack of memory, throws OutOfMemoryError.
freeMemory
public abstract int freeMemory()
- Returns an estimate of the amount of free memory available.
totalMemory
public abstract int totalMemory()
- Returns an estimate of the total memory allocated (both used and unused).
collect
public abstract void collect()
- Initiate a garbage collection.
processPtrField
public abstract void processPtrField(Memory.Address a)
- Process a reference to a heap object during garbage collection.
clsinitAndAllocateObject
public static java.lang.Object clsinitAndAllocateObject(Clazz.jq_Type t) throws java.lang.VerifyError
- Initialize class t and return a new uninitialized object of that type.
If t is not a class type, throw a VerifyError.
clone
public static java.lang.Object clone(java.lang.Object o) throws java.lang.OutOfMemoryError
- Clone the given object. NOTE: Does not check if the object implements Cloneable.
heapExhausted
public static void heapExhausted(Memory.Heap.Heap heap, int size, int count) throws java.lang.OutOfMemoryError
- Handle heap exhaustion.
outOfMemory
public static void outOfMemory() throws java.lang.OutOfMemoryError
- Called in an out of memory situation.
|
|||||||||
Home >> All >> [ Allocator overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: ![]() ![]() ![]() |
DETAIL: FIELD | CONSTR | METHOD |