malloc()
and free()
. These are userspace functions, which both use the sbrk()
system call to request and release memory allocated to the process.
In this homework, we create an alternative memory allocator, which provides the functions myalloc()
, and myfree()
. The performance of your allocator will be measured in terms of program runtime and fragmentation.
Turn-in requirements: make your changes to hw8.c only. Your solution will be graded based on performance in a variety of scenarios, some or all of which are already present in main.c.
./hw8 987987 Simple alloc/free, alloc/free cycle: 0, timediff:237 Coalescing free and splitting mymalloc: 0, timediff:29 After freeing coalesced blocks: -10320000, timediff:7 Random malloc and free sequence: 0, timediff: 698with 1000 16-byte spaced lists:
Simple alloc/free, alloc/free cycle: 0, timediff:291 Coalescing free and splitting mymalloc: 0, timediff:67 After freeing coalesced blocks: -10320000, timediff:7 Random malloc and free sequence: 0, timediff: 822with a single list:
Simple alloc/free, alloc/free cycle: 0, timediff:239 Coalescing free and splitting mymalloc: 0, timediff:29 After freeing coalesced blocks: -10320000, timediff:7 Random malloc and free sequence: 0, timediff: 2491without coalescing:
Simple alloc/free, alloc/free cycle: 100080000, timediff:332 Coalescing free and splitting mymalloc: 9216072, timediff:33 After freeing coalesced blocks: 8192064, timediff:0 Random malloc and free sequence: 497408, timediff: 2535with coalescing, but without splitting:
Simple alloc/free, alloc/free cycle: 0, timediff:230 Coalescing free and splitting mymalloc: 8192064, timediff:29 After freeing coalesced blocks: -10320000, timediff:7 Random malloc and free sequence: 0, timediff: 666
Copyright 2016 The Board of Trustees of the University of Illinois.webmaster@cs.uic.edu |
WISEST Helping Women Faculty Advance Funded by NSF | ![]() | ![]() |