需要实现执行分配的模拟机制,以及对存储器布局的压缩操作。模拟将尝试分配从存储器的最低地址(即从0)开始到最高地址的块。每个区块当内存没有空间容纳新块或相同的块ID时,分配可能会失败已存在于内存中。尝试解除分配不在中的块时,解除分配可能会失败记忆。当生成任何InstructionException时,您也应该作为argument此时可能的最大可分配内存,即的大小当时内存中最大的空闲插槽。请注意,此值在大多数情况下不是等于总可用内存。
Assignment 2: Memory Allocation
In this assignment, you need to simulate contiguous memory allocation using first fit, best fit,
and worst fit strategies. Refer to Chapter 9.2.2 for more information about them.
Problem statement:
In this assignment, you need to implement a simulation mechanism that performs allocations,
deallocations, and compact operations on a memory layout. The simulation will try to allocate
blocks starting from the lowest addresses of memory (i.e., from 0) to the highest ones. Each block
will have an integer ID. You can use any data structure you see fit to represent and handle your
memory, as long as your code imports el