public class QuickHeapManager { static private final int NULL = -1; // our null link static private final int QLSIZE = 10; // quickGet size public int[] memory; // the memory we manage private int freeStart; // head of general free list private int[] quickGet; // heads of quick lists /** * QuickHeapManager constructor. * @param initialMemory the int[] of memory to manage */ public QuickHeapManager(int[] initialMemory) { memory = initialMemory; memory[0] = memory.length; // one big free block memory[1] = NULL; // free list ends with it freeStart = 0; // free list starts with it quickGet = new int[QLSIZE]; // quick list heads int i = 0; // all quick lists are initially empty while (i < QLSIZE) quickGet[i++] = NULL; }