joeq.Allocator
Class DefaultHeapAllocator

java.lang.Object
  extended by joeq.Allocator.DefaultHeapAllocator

public abstract class DefaultHeapAllocator
extends Object

Provides access functions to the default heap allocator for the current thread.

Version:
$Id: DefaultHeapAllocator.java,v 1.15 2004/08/07 10:00:39 joewhaley Exp $
Author:
John Whaley

Field Summary
static jq_StaticMethod _allocateArray
           
static jq_StaticMethod _allocateArrayAlign8
           
static jq_StaticMethod _allocateObject
           
static jq_StaticMethod _allocateObjectAlign8
           
 
Constructor Summary
DefaultHeapAllocator()
           
 
Method Summary
static Object allocateArray(int length, int size, Object vtable)
          Allocate an array with the default heap allocator for the current thread.
static Object allocateArrayAlign8(int length, int size, Object vtable)
          Allocate an aligned array with the default heap allocator for the current thread.
static Object allocateObject(int size, Object vtable)
          Allocate an object with the default heap allocator for the current thread.
static Object allocateObjectAlign8(int size, Object vtable)
          Allocate an aligned object with the default heap allocator for the current thread.
static void collect()
           
static HeapAllocator def()
          The default heap allocator for the current thread.
static int freeMemory()
          Return the amount of free memory in the default heap allocator for the current thread.
static void init()
          Initialize the default heap allocator for the current thread.
static boolean isValidHeapAddress(Address a)
           
static void processObjectReference(Address a)
           
static void processPossibleObjectReference(Address a)
           
static int totalMemory()
          Return the total amount of memory us the default heap allocator for the current thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_allocateObject

public static final jq_StaticMethod _allocateObject

_allocateObjectAlign8

public static final jq_StaticMethod _allocateObjectAlign8

_allocateArray

public static final jq_StaticMethod _allocateArray

_allocateArrayAlign8

public static final jq_StaticMethod _allocateArrayAlign8
Constructor Detail

DefaultHeapAllocator

public DefaultHeapAllocator()
Method Detail

def

public static final HeapAllocator def()
The default heap allocator for the current thread.

Returns:
default heap allocator for the current thread

init

public static final void init()
                       throws OutOfMemoryError
Initialize the default heap allocator for the current thread.

Throws:
OutOfMemoryError

allocateObject

public static final Object allocateObject(int size,
                                          Object vtable)
                                   throws OutOfMemoryError
Allocate an object with the default heap allocator for the current thread.

Throws:
OutOfMemoryError

allocateObjectAlign8

public static final Object allocateObjectAlign8(int size,
                                                Object vtable)
                                         throws OutOfMemoryError
Allocate an aligned object with the default heap allocator for the current thread.

Throws:
OutOfMemoryError

allocateArray

public static final Object allocateArray(int length,
                                         int size,
                                         Object vtable)
                                  throws OutOfMemoryError,
                                         NegativeArraySizeException
Allocate an array with the default heap allocator for the current thread.

Throws:
OutOfMemoryError
NegativeArraySizeException

allocateArrayAlign8

public static final Object allocateArrayAlign8(int length,
                                               int size,
                                               Object vtable)
                                        throws OutOfMemoryError,
                                               NegativeArraySizeException
Allocate an aligned array with the default heap allocator for the current thread.

Throws:
OutOfMemoryError
NegativeArraySizeException

freeMemory

public static final int freeMemory()
Return the amount of free memory in the default heap allocator for the current thread.

Throws:
OutOfMemoryError

totalMemory

public static final int totalMemory()
Return the total amount of memory us the default heap allocator for the current thread.

Throws:
OutOfMemoryError

collect

public static final void collect()

isValidHeapAddress

public static final boolean isValidHeapAddress(Address a)

processObjectReference

public static final void processObjectReference(Address a)

processPossibleObjectReference

public static final void processPossibleObjectReference(Address a)


Copyright © 2001-2005 John Whaley. All Rights Reserved.