Assignment 9, due Apr. 16
Part of
the homework for 22C:112, Spring 2010
|
Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list! All assignments will be due at the start of class on the day indicated (usually a Friday). The only exceptions to this rule will be by advance arrangement unless there is what insurance companies call "an act of God" - something outside your control. Homework must be turned in on paper and in class! Late work may be turned in to the teaching assistant's mailbox, but see the late work policy. Never push late work under someone's door!
a) fork() (0.5 points)
b) wait() (0.5 points)
c) exit() (0.5 points)
d) pause() (0.5 points)
a) The keyboard input interrupt service routine. (0.5 points)
b) The real-time clock interrupt service routine. (0.5 points)
Write code for mymalloc() and myfree(), in a file called mp5.a. This file should conform to the following interface specification largely based on the man pages for malloc() and free():
/* mp5.h */ #define HEAPSIZE 4000 void * mymalloc( int size ); /* allocates a block of at least size bytes, or return NULL if impossible */ void free( void * ptr ); /* deallocates a block of memory */
Your heap should be a contiguous statically allocated array of HEAPSIZE bytes. The first call to malloc should initialize your heap. You should, of course, test your heap implementation before submission. Submit is using the submit mechanism. You are completely free to use any heap implementation supporting variable block sizes.