From 004ee1a449a80b37eb37fca23489127d29fd3fc2 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Tue, 6 Nov 2012 20:15:10 -0500 Subject: [PATCH] Fix up the basic errors in threadedAllocation --- threadedAllocation.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/threadedAllocation.java b/threadedAllocation.java index c6d3b96..08a567a 100644 --- a/threadedAllocation.java +++ b/threadedAllocation.java @@ -1,10 +1,13 @@ -class threadedAllocation extends baseAlgorithm +class threadedAllocation implements baseAlgorithm { - threadedAllocation { + int[] memoryBlock; + + threadedAllocation(int memorySize) { /* Constructor specific for this algorithm * * Start the threaded garbage collector, and then begin * our actual operations */ + memoryBlock = new int[memorySize]; } int locateBlock(int blockSize){ @@ -36,7 +39,7 @@ class threadedAllocation extends baseAlgorithm return -1; } - void allocate(int jobID, int jobSize, int jobLength ){ + public void allocate(int jobID, int jobSize, int jobLength ){ /* Over-rides allocate() of baseAlgorithm */ //Loop until we get a block big enough for our job @@ -54,7 +57,7 @@ class threadedAllocation extends baseAlgorithm //TODO: Code to start the job } - void deallocate(int jobSize, int beginningLocation){ + public void deallocate(int jobSize, int beginningLocation){ /* Over-rides deallocate() of baseAlgorithm */ //Simple algorithm, basically just mark the memory as cleared.