Evaluate the correctness and performance of your allocator

Assignment Help C/C++ Programming
Reference no: EM13945973

Implement a simple memory allocator based on the so-called "Buddy System" scheme, that allocates memory in blocks with sizes that are powers of two, starting at a block size that is given as an argument when the allocator is initialized.

* The memory allocator shall be implemented as a C module my_allocator, which consists of a header file my_allocator.h and my_allocator.c. It should provide the functions my_malloc() and my_free(), very similar to the UNIX calls malloc() and free().

* Evaluate the correctness (up to some point) and the performance of your allocator. For this use the given strange implementation of a highly-recursive Ackermann function. In this implementation of the Ackermann function, random blocks of memory are allocated and de-allocated sometime later, generating a large combination of different allocation patterns.

* Write a program called memtest, which reads the basic block size and the memory size (in bytes) from the command line, initializes the memory, and then calls the Ackermann function. It measures the time it takes to perform the number of memory operations. Make sure that the program exits cleanly if aborted (using atexit() to install the exit handler).

* Use the getopt() C library function to parse the command line for arguments. The synopsis of the memtest program is of the form

memtest [-b <blocksize>] [-s <memsize>]

-b <blocksize> defines the block size, in bytes. Default is 128 bytes.
-s <memsize> defines the size of the memory to be allocated, in bytes.
Default is 512kB.

* Repeatedly invoke the Ackermann function with increasingly larger values for n and m (be careful to keep n <= 3; the processing time increases very steeply for larger values of n).

* Make sure that the allocator gets de-allocated (and its memory freed) when the program either exits or aborts (for example, when the user presses Ctrl-C).

Please see the attachments for more details.

I have been tasked with the attached problem, and do not seem to make any progress.

Attachment:- MP1.zip

Reference no: EM13945973

Questions Cloud

Calculate the effective weighted average cost of capital : Calculate the effective Weighted Average Cost of Capital (WACC)using datafrom the consolidated financial statements, a value of 1.1 for ß and a risk-free rate of 1.3%.
Write the author name and title of essay : The objective is improved reading comprehension and analysis towards an advanced understanding of modern art theory. Write the author's name, title of essay
Find profitability index of the proposed project : Find the net present value, internal rate of return, payback period, discounted payback period, and profitability index of the proposed project. Based on your analysis should the project be accepted? Discuss.
Prepare a monthly cash budget for the last 6 months of 2014 : Prepare an estimate of the required financing (or excess funds)-that is, the amount of money Rusty's Renovations will need to borrow (or will have available to invest)- for each month during that period.
Evaluate the correctness and performance of your allocator : Repeatedly invoke the Ackermann function with increasingly larger values for n and m (be careful to keep n
How many shares of stock will you own : At what price would you expect the stock to sell on April 2, all other things the same (no signaling effect)? What will be the total value of your holdings before and after the stock dividend, all other things the same?
Describe five specific areas to improve company competitve : Select an advantage you identified, and provide a detailed scenario of how it could be leveraged to improve a company's competitive advantage.
Analyze the factors that drive supply and demand : Analyze the factors that drive supply and demand, different types of market structures in a free enterprise system, and factors of stability in a nation's economy - Examine the private enterprise systems, drivers of change on the system, ethical a..
Discussion alternate approaches and why your recommendation : Write a 500-word memo (APA Format) to the executive at Acer or Hewlett-Packard providing your recommendation for their organization that includes the following: ?A brief description of the situation

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Prepare a program to implement a for loop

Prepare a program to implement a for loop - Program: Write a for loop that sums all the odd integers between 5 and 20 inclusive.

  Program to compute the diameter in centimeters of steel rod

Input the compression load. Print the type of material, load, allowable stress, and diameter. Used formatted output with field with specifications that align output.

  C program to mips program

Convert the following C program to MIPS program. Assuming that i, j, k, f, are stored in registers $s0, $s1, $s2, $s3 already. The base address of arrays A and B are in registers $s4 and $s5, respectively. (30

  Redesign the ip network

Suppose you work for a company that has changed internet service providers and needs to redesign the IP network. From your new ISP, you have leased 200.200.200.0/24.

  C program to solve the quadratic equation of rocket launch

Write a C program to solve the quadratic equation of rocket launch by computing the roots (t1 and t2) of that quadratic equation: gt2 + vt + l = 0 (or) for simplicity ax2 + bx + c = 0. Get the values of g, v, and l from the user. The program should d..

  Part 1write a cc program to read a data file and extract

part 1write a cc program to read a data file and extract parameters. the program must obtain the filename via a

  Stored in the array points before line seven

Questions (i) to (vii) relate to the following code. A class called Point is defined and the code fragments that are called from main() are given line numbers 1 to 7.

  Write function compute square root together with prototype

Write a C++ function called compute together with its prototype that is passed 2 integers, A and B and returns the square root of A2+B2 ,as a double.

  Destroy sauron''s ring by throwing it into the volcano

In order to destroy Sauron's ring by throwing it into the volcano Mt. Doom in the heart of Mordor, the hobbits have traveled a long way from their home in the Shire.

  Program - cosc

Assignment is based on Programming Exercise - The input file has the needed data on a single line. There is text as well as the numerical inputs.

  Write a c function to find the norm of a matrix

Write a C function to find the norm of a matrix. The norm is defined as the square root of the sum of squares of all elements in the matrix. Write your own code please.

  Write a literal representing the long integer

Write a literal representing the long integer value twelve billion.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd