Preview

Malloc

Powerful Essays
Open Document
Open Document
3330 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Malloc
CS 61, Fall 2011
Assignment 4: Malloc: Writing a Dynamic Storage Allocator
Assigned: Tuesday, October 4
Design Checkpoint Deadline: Thursday, October 13, 10:00PM
Assignment due: Thursday, October 20, 11:59PM

1

Introduction

In this assignment you will write a dynamic storage allocator for C programs, that is, your own version of the malloc, free, and realloc routines. You are encouraged to explore the design space creatively and implement an allocator that is correct, efficient, and fast.
Please read this document in its entirety. It contains important information about the assignment and how you will be assessed, and provides hints for you to succeed at this assignment.
Any clarifications or revisions to this assignment will be posted on the course website.

2

Getting started

You can do this homework in groups of one or two students. Please go to the form at http://tinyurl.com/CS61-Fa11-malloc-groups and let us know your group. (This form is also linked to from the CS 61 web page.)
Please fill out the form even if you are working on this assignment by yourself —simply leave the
“Partner 2” fields blank.
Please fill in this form by 11:59pm, Sunday October 9.
In your home directory on your CS 61 VM, you should have a directory called malloc. Please contact course staff if you do not have this directory. The directory malloc contains several files.
The only file that you will modify and submit is the file mm.c.
The file mm.c contains a C structure team. Please edit this structure to add identifying information about your group. Do this right away so you don’t forget.

1

3

Implementing your dynamic storage allocator

Your dynamic storage allocator will consist of the following four functions, which are declared in mm.h and defined in mm.c. int mm_init(void); void *mm_malloc(size_t size); void mm_free(void *ptr); void *mm_realloc(void *ptr, size_t size);
The mm.c file we have given you implements the simplest but still

You May Also Find These Documents Helpful

  • Good Essays

    Some OS routines directly support application programs as they run and thus must be resident. Other transient routines are stored on disk and read into memory only when needed. Fixed-length partitions can also be used to allocate the set amount of memory that a particular program needs to run. Under dynamic memory management, the transient area is treated as a pool of unstructured free space. When the system decides to load a particular program, a region of memory just sufficient to hold the program is allocated from the pool. Using segmentation, programs are divided into independently addressed segments and stored in noncontiguous memory. Paging breaks a program into fixed-length pages.…

    • 7085 Words
    • 29 Pages
    Good Essays
  • Satisfactory Essays

    For the purpose of grading of the project you are required to perform the following tasks:…

    • 402 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Fins 2624 Assignment

    • 1893 Words
    • 8 Pages

    You may cooperate on this assignment in groups consisting of up to three students. If you prefer to work alone or with only one other student that is fine, too. Either way, make sure to enter the student IDs (including the letter) and names of all students in your group in the appropriate cells (B1:B6) on the Answers sheet. There will be draconian punishments for students that fail to do this.…

    • 1893 Words
    • 8 Pages
    Powerful Essays
  • Satisfactory Essays

    POS355 Week 1 Individual

    • 574 Words
    • 2 Pages

    There are several items that are pertinent to memory management such as, basic hardware, the binding of symbolic memory addresses to definite physical addresses and the difference between logical and physical addresses. The most important task that memory management executes is the distribution and collection of memory…

    • 574 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    Week 5 Pos 355

    • 2010 Words
    • 9 Pages

    Memory management is an important part of an operating. The UNIX/Linux OS use numerous intricate algorithms for memory management which will permit the system to…

    • 2010 Words
    • 9 Pages
    Better Essays
  • Powerful Essays

    Wsj3

    • 1014 Words
    • 4 Pages

    This is an INDIVIDUAL assignment. Submit your answers in hardcopy at the beginning of class. Check the syllabus for the due date. Handwritten answers are NOT acceptable. Use Word to write your answers.…

    • 1014 Words
    • 4 Pages
    Powerful Essays
  • Satisfactory Essays

    There are two steps listed below for this assignment. Respond to the questions for each step in this worksheet only and submit your completed document to the Assignment Files tab.…

    • 444 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Hi Every One

    • 424 Words
    • 2 Pages

    For the purpose of grading of the project you are required to perform the following tasks:…

    • 424 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Miss

    • 477 Words
    • 2 Pages

    In this assignment, you are required to complete Task A, B & C. All tasks must be submitted together for marking.…

    • 477 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Border Crossing

    • 253 Words
    • 2 Pages

    This outcome is to be completed in class in one lesson. It is your responsibility to hand in all work to your teacher at the end of the lesson. You may bring in the following only:…

    • 253 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Memory management is a critical piece of both Windows and Linux computer architecture that enables the computer to allocate the physical memory available between multiple processes. Windows and Linux memory management structures and algorithms have much in common, such as facilitating expansion of memory address space beyond the limits of physical memory through the use of virtual memory addressing that is coordinated with the available and used physical memory space. However, Windows and Linux memory management differs in many regards such as data structure format, how process address space is distributed, how paging is managed, the memory address structure, and the algorithm used for page swapping or replacement.…

    • 706 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    For the purpose of grading of the project you are required to perform the following tasks:…

    • 537 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Windows and Linux are two of the most commonly used operating systems to date. Windows is used more by beginners and everyday computer users, while Linux is used more by advanced users and is dubbed the hackers operating system. Both the operating systems have their advantages and their disadvantages. This paper will be differentiate the two in the operating systems memory management aspect.…

    • 647 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    1. Introduction ........................................................................................................................................ 1 2. Project Approach ................................................................................................................................ 1 3. Random Access Memory (RAM) ......................................................................................................... 1 3.1 Functionality of the RAM .............................................................................................................. 1 3.2 Design and Implementation .......................................................................................................... 2 3.3 Simulation and Testing.................................................................................................................. 2 3.4…

    • 5276 Words
    • 22 Pages
    Powerful Essays
  • Better Essays

    “Computers are stupid. They can only do three things: add two numbers, compare two numbers and REMEMBER” –Philip Mumford, High School Computer teacher…

    • 900 Words
    • 3 Pages
    Better Essays