forked from starnakin/IronGOLEM
add: free
This commit is contained in:
@ -1,10 +1,13 @@
|
||||
main()
|
||||
{
|
||||
local ptr1;
|
||||
local ptr2;
|
||||
name = "galloc";
|
||||
|
||||
dbg galloc(1);
|
||||
dbg galloc(1);
|
||||
dbg galloc(1);
|
||||
dbg galloc(1);
|
||||
dbg galloc(1);
|
||||
|
||||
ptr1 = galloc(1);
|
||||
test_str(ptr1, heap + LOCATION_DATA, "");
|
||||
free(ptr1);
|
||||
ptr1 = galloc(1);
|
||||
test_str(ptr1, heap + LOCATION_DATA, "alloc after free");
|
||||
ptr2 = galloc(1);
|
||||
}
|
||||
|
13
tests/test.🗿
13
tests/test.🗿
@ -1,17 +1,6 @@
|
||||
global name;
|
||||
|
||||
putstr(str){
|
||||
local i;
|
||||
i = 0;
|
||||
loop {
|
||||
if ([str + i] == 0)
|
||||
return;
|
||||
wrt [str + i];
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
test(value, reach_value, description)
|
||||
test_str(value, reach_value, description)
|
||||
{
|
||||
putstr(name);
|
||||
if (value != reach_value)
|
||||
|
Reference in New Issue
Block a user