lib/os.rb
def deallocate!(pid:)
    pcb = @process_control_blocks.select { |p| p.pid == pid }.first

    if pcb.nil?
      raise NonExistentProcessError, "That process doesn't exist!"
      return
    end

    @process_control_blocks.delete pcb

    @memory.free! :frames => pcb.page_table.values
  end
# Removes all memory from a process
#
# @param pid [Integer] the process to deallocate memory from
#
# @return [Array] the memory's free frame list
Removes all memory from a process
Removes all memory from a process
def deallocate!(pid:)
    pcb = @process_control_blocks.select { |p| p.pid == pid }.first
    if pcb.nil?
      raise NonExistentProcessError, "That process doesn't exist!"
      return
    end
    @process_control_blocks.delete pcb
    @memory.free! :frames => pcb.page_table.values
  end
def deallocate! ( pid : ) pcb = @process_control_blocks . select { | p | p . pid == pid } . first if pcb . nil? raise NonExistentProcessError , "That process doesn't exist!" return end @process_control_blocks . delete pcb @memory . free! :frames => pcb . page_table . values end
Removes all memory from a process
Removes all memory from a process
the memory's free frame list
the memory ' s free frame list
Array
pid
the process to deallocate memory from
the process to deallocate memory from