Removed unnecessary casts.
This commit is contained in:
parent
f49256d7e7
commit
dd07283ffc
4
main.c
4
main.c
@ -88,7 +88,7 @@ void* malloc(size_t size)
|
|||||||
freeList = b;
|
freeList = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (struct block*)b + 1;
|
return b + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Will flag the provided memory as free and will defragment other blocks adjacent to it.
|
/// Will flag the provided memory as free and will defragment other blocks adjacent to it.
|
||||||
@ -100,7 +100,7 @@ void free(void* ptr)
|
|||||||
if (!ptr)
|
if (!ptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
struct block* b = (struct block*)ptr - 1;
|
struct block* b = ptr - 1;
|
||||||
b->free = 1;
|
b->free = 1;
|
||||||
|
|
||||||
struct block* link = b->next;
|
struct block* link = b->next;
|
||||||
|
Loading…
Reference in New Issue
Block a user