ADD: Added the header file mymalloc.h which contains the function prototypes
which will be used by mymalloc.c

This header file is composed of 8 function prototypes, myinit(), myinit_mt(), 
mymalloc(), mymalloc_mt(), myfree(), myfree_mt(), mydispose() and mydispose_mt().
Each of these functions will be implemented in full in mymalloc.c.

TODO: Create mymalloc.c, harness.c and a Makefile to test our implementation
of a dynamic memory allocator.
ADD: Created the barebones of each function required to implement single and multithreaded versions of our
dynamic memory allocator.

TODO: Implement basic functionality for each of the single threaded functions, including myinit(), 
mymalloc() and myfree().
ADD: Copied and pasted the test harness found on the COMP2009 module page 
(https://secure.ecs.soton.ac.uk/notes/comp2009/harness.html). 

This test harness will be used to test our implementation of the single threaded dynamic
memory allocator.
ADD: Created a Makefile to allow us to easily compile our program
DOC: Added an explanation to the top of the file explaining the algorithm and
data structure we will use.
ADD: Implemented myinit() functionality.

myinit() initialises an array ready for use with our mymalloc() and myfree() functions, by adding
the appropriate header elements to the start of the array. It returns 0 if the supplied array is
too small to be used.
FMT: Converted files to use spaces for indents instead of tabs.

Space indentation works better with version control as opposed to tab character-indenting. We have agreed to use a tab-width of 4 spaces.
REF: Improved readability and maintainability of make file, by using variables to control the compiler.
ADD: Added the basic functionality of the myfree() function.

Currently the myfree() function only frees a block which is used, and does not coalesce with a
free block which precedes or proceeds it. Have also added a check to the myfree() function which 
ensures the block given is not null or currently free.

TODO: Implement coalescing of free blocks in the myfree() function
ADD: Implemented basic mymalloc() functionality.

Currently the mymalloc() function returns a pointer to the allocated block (if available) only
after checking to make sure there aren't any other blocks in the array that are a better fit.
However a quick exit algorithm has been implemented, so that if a block is found that is the same
size as the required size, then that block is used and the loop ends.

TODO: Improve efficiency (see test results below). Currently, when trying to allocate a block, the
algorithm loops through and checks each individual block. Perhaps a method could be implemented that
only loops over the free blocks?

TEST RESULTS:
Possible mymallocs = 1107 ( overhead: 0.000613s )
Successful mymallocs = 979 ( 88.437218%, valid pointers: 380 ) in 0.004310s
ADD: The myfree() function allows a block to coalesce with a free block in front of it.

This feature was added to increase efficiency by reducing external fragmentation. It works by 
checking if the next block is free (denoted by a +ve value for the header), if it is then the
blocks are joined together. This is achieved  by modifying the size of the first header element of 
the first block and the last header element of the block it is being joined to.

Test results show that this does successfully increase efficiency:

Before implementation of coalescing with next free block:

	Possible mymallocs = 992 ( overhead: 0.000000s )
	Successful mymallocs = 915 ( 92.237903%, valid pointers: 386 ) in 0.010000s

After implementation of coalescing with next free block:

	Possible mymallocs = 992 ( overhead: 0.000000s )
	Successful mymallocs = 936 ( 94.354839%, valid pointers: 394 ) in 0.000000s

TODO: We need to implement a method for coalescing with the previous free block. This should reduce
external fragmentation further and increase efficiency.
FIX: Bug found which allowed the myfree() function to write to memory after the heap.             

The fix implemented means a check is now made to ensure the address of the next block is smaller
than the last address of the heap/memory-array before trying to join free blocks together. 
The inclusion of this condition ensures that we don't overwrite memory which is not ours:

(block + blockSize + 1) < &array[array[0]-1]

This essentially means that the address of the next block needs to be less than the last
address of the memory array.
ADD: The myfree() function now allows a block to coalesce with a previous free block.

This feature was added to increase efficiency by reducing external fragmentation. It works by 
checking if the previous block is free (denoted by a +ve value in the header), if it is then the
blocks are joined together. This is achieved  by modifying the size of the first header of 
the previous block and the last header element of the current block.

Test results show that this does successfully increase efficiency:

Before implementation of coalescing with previous free block:

	Possible mymallocs = 992 ( overhead: 0.000000s )
	Successful mymallocs = 936 ( 94.354839%, valid pointers: 394 ) in 0.000000s

After implementation of coalescing with previous free block:

	Possible mymallocs = 992 ( overhead: 0.000000s )
	Successful mymallocs = 975 ( 98.286290%, valid pointers: 407 ) in 0.000000s
FIX: Added check to mymalloc() that ensures that the passed size is valid.

This is a fix for any errors that might occur when trying to allocate memory with a size of 0
(or less).
REF: Condensed if/else statement when traversing the blocks inside the loop in mymalloc(). This
makes the code easier to read, allowing the flow of the program to be understood easier. However,
this modification hasn't had any impact on the efficiency.
ADD: The mydispose() function has now been implemented

Works by checking if the array has been initalised correctly. The checks made in the mydispose()
function are:
	a) Check is the array has a size greater than 127
	b) Check the the first block is the array size - 3 as this indicates all blocks are free
ADD: Copied and pasted the multi-threaded test harness found on the COMP2009 module page 
(https://secure.ecs.soton.ac.uk/notes/comp2009/harness.html). 

This test harness will be used to test our implementation of the multi-threaded dynamic
memory allocator.
ADD: Added the ability to compile multi-threaded versions of our code

Usage: 
	make:	 	compiles a single threaded ( mymalloc ) and multithreaded ( mymalloc_mt ) 
			versions of our code

	make clean:	removes all the files created by make
ADD: Implemented multi-threading. Updated functions include:
	mymalloc_mt()
	myfree_mt()
	mydispose_mt()

TEST RESULTS:

Thread 8 exits: 149 allocs and 149 frees in 0.040000s
Thread 1 exits: 151 allocs and 151 frees in 0.050000s
Thread 0 exits: 167 allocs and 167 frees in 0.050000s
Thread 6 exits: 141 allocs and 141 frees in 0.050000s
Thread 3 exits: 148 allocs and 148 frees in 0.050000s
Thread 4 exits: 156 allocs and 156 frees in 0.050000s
Thread 9 exits: 164 allocs and 164 frees in 0.050000s
Thread 5 exits: 168 allocs and 168 frees in 0.050000s
Thread 7 exits: 161 allocs and 161 frees in 0.050000s
Thread 2 exits: 161 allocs and 161 frees in 0.050000s

TODO: Initial implementation for our malloc is now finished. However, when running on a large array
we find that it takes a long time to complete e.g.

	SEED=42 SIZE=9999999
	
	Possible mymallocs = 147079 ( overhead: 3.240000s )
	Successful mymallocs = 145722 ( 99.077367%, valid pointers: 58030 ) in 63.390000s

Therefore we plan to change our implementation to use a singly linked list of free blocks, each 
with one header. We feel that this should increase the efficiency and significantly decrease the 
time it takes to perform mallocs and frees.
RESET: Removed the contents of myinit(), mymalloc() and myfree().

We have decided that our method of storing data (and free cells) in the array is too slow, and so
we are going to reimplement the array structure so that we have a doubly-linked list of free cells. Because of this, the current core of the program is irrelevant and needs to be rewritten.

TODO: Implement the main functionality of the program to handle a doubly-linked list of free cells in the array.