没有合适的资源?快使用搜索试试~ 我知道了~
首页CSAPP lab 5 实验指导书
In this lab you will be writing a dynamic storage allocator for C programs, i.e., your own version of the malloc and free routines. It is quite involved. Start early! We are providing some extra homeworkstyle practice problems for memory allocation in case you find them helpful in preparing for lab 5. They will not be graded (no credit), they are just good practice. Read section 9.9 from the textbook for review. (Note "word" means 4 bytes for these problems.) 1.Practice Problem 9.6 2.Practice Problem 9.7 3.Practice Problem 9.10 4.Homework Problem 9.15 5.Homework Problem 9.16
资源详情
资源评论
资源推荐

2014年9月7日 CSE 351 Course Website - Spring 2014
http://courses.cs.washington.edu/courses/cse351/14sp/lab-5.html 1/7
Lab5:WritingaDynamicStorageAllocator
Assigned Wednesday,May28,2014
DueDate Friday,June6,2014at5:00pm
Files lab5.tar.gz(labs/lab5/lab5.tar.gz)
Submissions
Submityourcompletedmm.cfilehere
(https://catalyst.uw.edu/collectit/assignment/gaetano/31190/125998).
Overview
InthislabyouwillbewritingadynamicstorageallocatorforCprograms,i.e.,yourownversionofthemallocandfree
routines.Itisquiteinvolved.Startearly!
OptionalPracticeProblems
Weareprovidingsomeextrahomeworkstylepracticeproblemsformemoryallocationincaseyoufindthemhelpfulin
preparingforlab5.Theywillnotbegraded(nocredit),theyarejustgoodpractice.Readsection9.9fromthetextbookfor
review.(Note"word"means4bytesfortheseproblems.)
1. PracticeProblem9.6
2. PracticeProblem9.7
3. PracticeProblem9.10
4. HomeworkProblem9.15
5. HomeworkProblem9.16
Instructions
Startbyextractinglab5.tar.gztoadirectorywhereyouplantodoyourwork:
wget cs.washington.edu/education/courses/cse351/14sp/labs/lab5/lab5.tar.gz
tar xzvf lab5.tar.gz
Thiswillcauseanumberoffilestobeunpackedinadirectorycalledlab5.Theonlyfileyouwillmodifyandturninismm.c.
(Inthefollowinginstructions,wewillassumethatyouareexecutingprogramsinyourlocaldirectoryonattuoryourVM.For
thislab,youcanworkanywherethere'saCcompilerandmake,includingyourVM.)
Yourdynamicstorageallocatorwillconsistofthefollowingthreefunctions(andseveralhelperfunctions),whichare
declaredinmm.handdefinedinmm.c:
int mm_init(void);
void* mm_malloc(size_t size);
void mm_free(void* ptr);
Themm.cfilewehavegivenyoupartiallyimplementsanallocatorusinganexplicitfreelist.Yourjobistocompletethis
implementationbyfillingoutmm_malloc()andmm_free().Thethreemainmemorymanagementfunctionsshouldworkas
follows:

















安全验证
文档复制为VIP权益,开通VIP直接复制

评论1