mirror of
https://github.com/zeldaret/mm.git
synced 2026-05-23 15:01:32 -04:00
Misc Cleanup (#1257)
* a lot of brackets, and some other things * oops * another bracket * check flag all * just a few more... * PR suggestions * PR comment * pr * one more bracket
This commit is contained in:
@@ -275,7 +275,7 @@ void __osFree(Arena* arena, void* ptr) {
|
||||
|
||||
node = (ArenaNode*)((uintptr_t)ptr - sizeof(ArenaNode));
|
||||
|
||||
if (ptr != NULL && node->magic == NODE_MAGIC && !node->isFree) {
|
||||
if ((ptr != NULL) && (node->magic == NODE_MAGIC) && !node->isFree) {
|
||||
next = node->next;
|
||||
prev = node->prev;
|
||||
node->isFree = true;
|
||||
@@ -297,7 +297,7 @@ void __osFree(Arena* arena, void* ptr) {
|
||||
|
||||
// Checks if the previous node is contiguous to the current node and if it isn't currently allocated. Then merge
|
||||
// the two nodes into one.
|
||||
if (prev != NULL && prev->isFree && (uintptr_t)node == (uintptr_t)prev + sizeof(ArenaNode) + prev->size) {
|
||||
if ((prev != NULL) && prev->isFree && ((uintptr_t)node == (uintptr_t)prev + sizeof(ArenaNode) + prev->size)) {
|
||||
if (next != NULL) {
|
||||
next->prev = prev;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ void* SystemHeap_RunBlockFunc8(void* blk, size_t nBlk, size_t blkSize, BlockFunc
|
||||
blk = SystemHeap_Malloc(nBlk * blkSize);
|
||||
}
|
||||
|
||||
if (blk != NULL && blockFunc != NULL) {
|
||||
if ((blk != NULL) && (blockFunc != NULL)) {
|
||||
uintptr_t pos = blk;
|
||||
|
||||
for (; pos < (uintptr_t)blk + (nBlk * blkSize); pos += (blkSize & ~0)) {
|
||||
|
||||
Reference in New Issue
Block a user