In this exercise, we simulate a memory allocation (we just want to see the effect of
fragmentation and of compacting memory fragments into larger ones). For this, we
manage a list of memory segments in our program:
typedef struct segment {
int start ;
int size ;
int status ;
struct segment * next ;
} segment_t ;
The above segment descriptor describes a memory segment in terms of its start address,
its size and whether it is ALLOCATED or FREE. This descriptor is part of a list
(contains a pointer to next segment descriptor). Initially, there is only one segment with
status == FREE, describing the complete memory as one segment.
Hello,
I have 25 years experience programming in C++. I will create this memory allocation manager for you in C++.
Alan Idler
Chief Software Architect
Idleswell Software Creations