aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranciszek Malinka <franciszek.malinka@gmail.com>2021-12-27 23:09:29 +0100
committerFranciszek Malinka <franciszek.malinka@gmail.com>2021-12-27 23:09:29 +0100
commit1f402478f49d24a1a7a72650258cd77a89213b1f (patch)
treeef0fff8337a1c3a4f6dbee94730307b04829f304
parent67d18276ce79b090c0e6cbcfbf1efa39006457a4 (diff)
Last edits
-rw-r--r--mm.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/mm.c b/mm.c
index 1237441..c5361f7 100644
--- a/mm.c
+++ b/mm.c
@@ -139,15 +139,18 @@
*
* I didn't implement mm_checkheap. It was more convinient for me to implement
* separate functions for printing and checking integrity of the heap and data
- * structures. All those functions are run only if the DEBUG flags is defined,
- * otherwise their body is empty. I also used sanitzer. What I checked in those
- * debug functions:
+ * structures. All those functions are run only if the DASSERT flags is defined.
+ * There is debug ouput only if both DASSERT and DEBUG flags are defined.
+ * I also used sanitzer. What I checked in those debug functions:
*
* - Integrity of the heap, i.e. check if there are no adjacent free blocks,
* check if prevfree bits are set correctly, check if last block is actually
* the last block, check if last block ends with the heap.
* - Integrity of the free block list, if the size in both boundary tags are
- * equal, if none of them has the prevfree block set
+ * equal, if none of them has the prevfree block set etc.
+ *
+ * There are also many assert in other functions. They also serve as a hint
+ * about assumptions the function has (e.g. argument points to a free block).
*/
#include <assert.h>
@@ -589,6 +592,8 @@ static free_block_t *find_fit(size_t reqsz) {
return root;
}
+/* --=[ Debug functions ]=-------------------------------------------------- */
+
#ifdef DASSERT
static void print_splay(node_t *node, int ind) {
if (is_sentiel(node))