Coder Social home page Coder Social logo

rhythm-divine / os_memory_allocation-project Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 25 KB

A C++ implementation of operating system memory allocation algorithms using a doubly linked list.

C++ 100.00%
cpp operating-system linked-list principles-of-programming-languages

os_memory_allocation-project's Introduction

OS_Memory_Allocation-Project

This project is about implementing memory allocation algorithms in C++ to allocate memory to different processes using a doubly linked list. The algorithms implemented in this project are First-Fit, Best-Fit, Next-Fit and Worst-Fit.

The project contains a C++ implementation of a memory allocation class. This class contains the implementation of the above-mentioned algorithms along with a method to merge the fragmented memory blocks.

The class named "memory" is created that has four variables to keep track of the data, memory allocation, and the next and previous blocks in the memory.

The NewBlock method is used to create a new block of memory, and the printResult method is used to print the memory allocation results on the screen.

Each method takes a pointer to the head of the memory block and the size of the data to be allocated as input. These methods allocate memory based on the algorithm used, and the allocated block is marked as "allocated" in the memory. The memory is visualised using a linked list.

The mergeMemory method is used to merge the fragmented memory blocks, which are not currently being used. This method takes a reference to the head of the memory block as input.

This project is useful for anyone who wants to understand the memory allocation algorithms and implement them in their own projects. This project can be used as a reference for implementing memory allocation algorithms in any programming language.

os_memory_allocation-project's People

Contributors

rhythm-divine avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.