Commit 9ea0d618 authored by Lindsay Knupp's avatar Lindsay Knupp
Browse files

answers.txt

parent 790bb27f
......@@ -59,7 +59,7 @@ void *allocate(size_t size, int alloc_type){
struct dnode *smallest_block;
for (curr_data = dlist_iter_begin(free_list); curr_data != NULL; curr_data = dlist_iter_next(free_list)) {
if(curr_data->size - size < min){
if((curr_data->size - size < min) && (curr_data->size > size) ){
smallest_block = curr_data;
}
}
......@@ -76,7 +76,7 @@ void *allocate(size_t size, int alloc_type){
struct dnode *largest_block;
for (curr_data = dlist_iter_begin(free_list); curr_data != NULL; curr_data = dlist_iter_next(free_list)) {
if(curr_data->size - size > max ){
if((curr_data->size - size > max) && (curr_data->size > size) ){
largest_block = curr_data;
}
}
......
Lindsay Knup
11/08/21
Lab 8 - answers.txt
(1.1) External fragmentation is possible since whenever you deallocate a node from the allocated list, it just gets appended to the end of the free-list with no care for the address of the node that just got freed.
(1.2) I could calculate the average time it takes for each memory-test to run each with a different allocation policy. I could also calculate the average time the allocate function takes in comparison to the deallocate function.
(1.3)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment