• 大小: 9KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-06
  • 语言: Java
  • 标签: 操作系统  java  

资源简介

操作系统内存分配与回收模拟实验。本项目包含首次适应算法和循环时应算法。通过Java实现了操作系统的内存分配与回收,简单易懂,如果有好的写法望指正

资源截图

代码片段和文件信息

package com.it.bnuz.yzy;

public class FreeNode implements Comparable {
    private int before = -1;
    private int startLocation;
    private int size;
    private int next = -1;

    public FreeNode(int size) {
        this.size = size;
    }

    public int getBefore() {
        return before;
    }

    public void setBefore(int before) {
        this.before = before;
    }

    public int getStartLocation() {
        return startLocation;
    }

    public void setStartLocation(int startLocation) {
        this.startLocation = startLocation;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getNext() {
        return next;
    }

    public void setNext(int next) {
        this.next = next;
    }

    @Override
    public int compareTo(FreeNode o) {
        return this.startLocation - o.getStartLocation();
    }

    @Override
    public String toString() {
        String str = “[before:“+before+“ startLocation:“+startLocation+“ size:“+size+“ next:“+next+“]“;
        return str;
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-12-05 11:24  Memory_distribution\.idea\
     文件         237  2020-12-03 14:37  Memory_distribution\.idea\.gitignore
     文件         278  2020-12-03 14:37  Memory_distribution\.idea\misc.xml
     文件         285  2020-12-03 14:37  Memory_distribution\.idea\modules.xml
     文件        6896  2020-12-05 11:24  Memory_distribution\.idea\workspace.xml
     文件         433  2020-12-03 14:37  Memory_distribution\Memory_distribution.iml
     目录           0  2020-12-03 14:37  Memory_distribution\src\
     目录           0  2020-12-03 14:37  Memory_distribution\src\com\
     目录           0  2020-12-03 14:37  Memory_distribution\src\com\it\
     目录           0  2020-12-03 14:37  Memory_distribution\src\com\it\bnuz\
     目录           0  2020-12-04 21:35  Memory_distribution\src\com\it\bnuz\yzy\
     文件        1169  2020-12-03 20:08  Memory_distribution\src\com\it\bnuz\yzy\FreeNode.java
     文件        4093  2020-12-04 21:03  Memory_distribution\src\com\it\bnuz\yzy\Main.java
     文件       15926  2020-12-04 21:35  Memory_distribution\src\com\it\bnuz\yzy\MemoryManager.java
     文件         458  2020-12-03 16:25  Memory_distribution\src\com\it\bnuz\yzy\ProcessNode.java
     文件        1433  2020-12-04 17:45  Memory_distribution\src\com\it\bnuz\yzy\UseNode.java

评论

共有 条评论