mm.c free block footer

80 views
Skip to first unread message

Sam

unread,
Nov 26, 2020, 1:24:20 PM11/26/20
to cmpt-295-sfu
# Question templates
SFU ID: 301404717
Github username:ahmadsami07
Github: Link to github repo (your assignment repos are private so these links are only accessible to TAs and Instructor)https://github.com/CMPT-295-SFU/assignment-5-ahmadsami07
Line and file: mm.c, 437,447
Expected behavior:NA
Observed behavior:NA
Question:I was following the lab video and I was unsure on how to set the footer for the free block. Also, I am unsure about whether my masking for my allocated block is correct and if interpreted the professor correctly. Any suggestions would be greatly appreciated, thank you

ali sedaghati

unread,
Nov 26, 2020, 2:30:17 PM11/26/20
to cmpt-295-sfu
So the footer is going to be used to make coalescing possible. It should be at the end of a block, so the next block could use it to get to the header tags. You have to use UNSCALED_POINTER_ADD to get to the near of the end of the block and then write there. 
I didn't get your second question. Could you clarify it, please?

Sam

unread,
Nov 26, 2020, 3:19:56 PM11/26/20
to cmpt-295-sfu
Hi,
Thank you, I understand how to make the footer work now. It will basically also have same data as the header. My second question was relating to my code in line 447, I tried to follow lab 9 instr, but I'm not sure if I have grasped it correctly. So I was looking forward to some suggestions. Thanks a lot

ali sedaghati

unread,
Nov 27, 2020, 4:21:45 PM11/27/20
to cmpt-295-sfu
I think in your new commit the line number has been changed. 
Reply all
Reply to author
Forward
0 new messages