add: galloc: leak check
This commit is contained in:
parent
7e0c7180d3
commit
c6608ad4eb
@ -157,3 +157,8 @@ free(ptr)
|
||||
last_block = next_block;
|
||||
galloc_merge_blocks(first_block, last_block);
|
||||
}
|
||||
|
||||
leaks()
|
||||
{
|
||||
return (heap + LOCATION_NEXT != NULL);
|
||||
}
|
||||
|
@ -16,4 +16,7 @@ main()
|
||||
|
||||
ptr2 = galloc(0x9000);
|
||||
test_num(ptr2, 0, "alloc too big");
|
||||
free(ptr2);
|
||||
|
||||
test_num(leaks(), 1, "leaks");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user