mirror of
https://github.com/bspeice/itcs3146-project
synced 2024-12-22 14:48:21 -05:00
Fix up the basic errors in threadedAllocation
This commit is contained in:
parent
43890ea1b9
commit
004ee1a449
@ -1,10 +1,13 @@
|
|||||||
class threadedAllocation extends baseAlgorithm
|
class threadedAllocation implements baseAlgorithm
|
||||||
{
|
{
|
||||||
threadedAllocation {
|
int[] memoryBlock;
|
||||||
|
|
||||||
|
threadedAllocation(int memorySize) {
|
||||||
/* Constructor specific for this algorithm
|
/* Constructor specific for this algorithm
|
||||||
*
|
*
|
||||||
* Start the threaded garbage collector, and then begin
|
* Start the threaded garbage collector, and then begin
|
||||||
* our actual operations */
|
* our actual operations */
|
||||||
|
memoryBlock = new int[memorySize];
|
||||||
}
|
}
|
||||||
|
|
||||||
int locateBlock(int blockSize){
|
int locateBlock(int blockSize){
|
||||||
@ -36,7 +39,7 @@ class threadedAllocation extends baseAlgorithm
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void allocate(int jobID, int jobSize, int jobLength ){
|
public void allocate(int jobID, int jobSize, int jobLength ){
|
||||||
/* Over-rides allocate() of baseAlgorithm */
|
/* Over-rides allocate() of baseAlgorithm */
|
||||||
|
|
||||||
//Loop until we get a block big enough for our job
|
//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
|
//TODO: Code to start the job
|
||||||
}
|
}
|
||||||
|
|
||||||
void deallocate(int jobSize, int beginningLocation){
|
public void deallocate(int jobSize, int beginningLocation){
|
||||||
/* Over-rides deallocate() of baseAlgorithm */
|
/* Over-rides deallocate() of baseAlgorithm */
|
||||||
|
|
||||||
//Simple algorithm, basically just mark the memory as cleared.
|
//Simple algorithm, basically just mark the memory as cleared.
|
||||||
|
Loading…
Reference in New Issue
Block a user