Lets say I have a Variable Partitioning with free space: at address 32k a free space of 8k, and at address 15k a free space of size 11k.
I need to create a first fit free table.
Am I doing the right thing?
+--------+-------+
|address | size |
|32 |8 |
|15 |11 |
+--------+-------+
Basically, yes, that’s correct.
Although, unless you want your allocation function to only work with multiples of 1K, you may want to store the byte addresses and counts, eg, 32K is 32,768.