Preview

Malloc Lab

Powerful Essays
Open Document
Open Document
1604 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Malloc Lab
动态内存分配实验报告
Malloc Lab
(Dynamic Storage Allocators)
07300720035 电子信息科学与技术 王泮渠
(Department of Electrical Engineering, Chris Wang)

2010.01.02

INTRODUCTION
In this lab you will be writing a dynamic storage allocator for C program,i.e.,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.

PREPARATIONS
Read the introduction of malloc_lab carefully and think about it in depth. It shows us how to on the program, how to check our syntax and grammars, and how to evaluate our performance and find how to improve it.
The text book CSAPP is always your best instructor and helper. It provide with an original version of Implicit Free List. Although its performance is relatively low, it shows the basic program structure and algorithm about dynamic memory allocators. Also, we can get familiar with all functions, libraries, pointers and variables used in the gigantic program.
We should cautiously select our algorithm and data structure used in the program to meet with the request and evaluation system of malloc_lab. The most important, our program must be run on the server successfully, smoothly and efficiently without any errors, bugs or leaks.

ABOUT MY PROGRAM
DATA STRUCTURE
As mentioned above, the original version of implicit free list introduced in the text book is a good gateway program, but it can be only the gateway, cannot be the summit. As we all know, although implicit free list is simple, a significant disadvantage is that the cost of any operation, such as placing allocated blocks, that requires a search of the free list will be linear in the total number of allocated free blocks in the heap. As a result, implicit free list is not appropriate for a general-purpose allocator.
So I turned to the Explicit Free List. Since by definition the body of a free block is not needed by the program, the pointers that

You May Also Find These Documents Helpful

  • Satisfactory Essays

    LAB 20C

    • 561 Words
    • 3 Pages

    1. Moles of NaOH = 0.500 mol/L X 0.010525 L = 5.26 x 10-3 mol…

    • 561 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Exercise 1: Review of array-based lists Create a project using the classes in the DocSharing area labeled “User-defined array list." Compile it, run it, and review the code that is given carefully. This code tests the ArrayList class provided in the lecture.…

    • 714 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Lab assign

    • 276 Words
    • 2 Pages

    How long from the time the client issued the initial SYN did it take the server to answer with the SYN-ACK?…

    • 276 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Lab 5

    • 2594 Words
    • 10 Pages

    In gymnosperms, pollination is the transfer of pollen (Fig. 2) from male cones (where pollen is produced) to female cones, which house eggs. In these plants, pollen is carried from male cones to female cones by wind - gymnosperms were the first plants to evolve that did not need free water to transfer sperm to egg, and were therefore able to thrive in terrestrial habitats. Pollen grains are also protected by tough coats. After fertilization, seeds are produced with developing embryos…

    • 2594 Words
    • 10 Pages
    Good Essays
  • Powerful Essays

    lab 1

    • 636 Words
    • 3 Pages

    Are there any safety concerns associated with this exercise? If so, list what they are and what precautions should be taken.…

    • 636 Words
    • 3 Pages
    Powerful Essays
  • Satisfactory Essays

    Lab 12

    • 441 Words
    • 3 Pages

    2. Use your procedure to find g on Planet X. Show your data, graphs, and calculations that support your conclusion.…

    • 441 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Lab 1

    • 567 Words
    • 3 Pages

    Attacker would avoid detection by covering tracks step of the hacking process where they cover up their tracks in the system they hacked into.…

    • 567 Words
    • 3 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
  • Satisfactory Essays

    Lab 1

    • 414 Words
    • 2 Pages

    4. Why would you use a tool like DevManView while performing a computer forensic investigation?…

    • 414 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Lab 12

    • 3059 Words
    • 13 Pages

    In this lab you will use the Wireshark packet analyzer to capture and display the control information and data stored in packets transmitted over a network. Wireshark collects network traffic data and creates files that display packet header information in a layered format like that used by the Internet model. These layers can be expanded to view details that may prove helpful in determining the source of problems that your network might be experiencing. Creating filters that hide unwanted data and facilitate data analysis will also be discussed in this lab.…

    • 3059 Words
    • 13 Pages
    Powerful Essays
  • Satisfactory Essays

    Lab 9

    • 1001 Words
    • 3 Pages

    1. What are some common risks, and vulnerabilities commonly found in the System/Application Domain that must be mitigated with proper security countermeasures?…

    • 1001 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    lab 1

    • 2921 Words
    • 18 Pages

    entire exercise before you begin. Take time to organize the materials you will need and set…

    • 2921 Words
    • 18 Pages
    Good Essays
  • Satisfactory Essays

    Prg 211

    • 393 Words
    • 2 Pages

    To determine which types of selection structures, each groups or blocks of statements must be tested to determine which of these statements can be executed. 1) A single alternative structure contains only a single block of statements. If the test condition is met, the statements are executed. The statements are skipped if the test condition is not met. 2) There are two blocks of statements in a dual alternative structure. If the first block is executed after the test condition is met, then the program skips over the second block. If the first block of statements failed the test condition, it will be skipped and the second block is executed. 3) Containing more than two blocks of…

    • 393 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    Lab Three

    • 1684 Words
    • 7 Pages

    In this laboratory we utilize simple measures of physical quantities (for example, distance, and mass) and use the measurements to calculate or convert other physical quantities (such volume and area). We also use mathematical calculations and formulas to make conversions from one unit of measurement into another unit of measurement (for example, a conversion from meters to centimeters or Fahrenheit to Celsius)…

    • 1684 Words
    • 7 Pages
    Better Essays
  • Good Essays

    M&M Lab

    • 533 Words
    • 3 Pages

    1. When you performed Step 2 of the procedure, you actually made a cylinder of M&Ms. The cylinder was rather "smushed," and the height of the cylinder was the thickness of an M&M. Recall that the equation for the volume of a cylinder is V = (3.14)r2h.…

    • 533 Words
    • 3 Pages
    Good Essays

Related Topics