81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
puts("Trying to allocate more memory than possible...");
CATCH_EXCEPTION(p = [obj getMemWithSize: 4294967295U], OFNoMemException)
puts("Allocating 1 byte...");
p = [obj getMemWithSize: 1];
puts("Trying to resize that 1 byte to more than possible...");
CATCH_EXCEPTION(p = [obj resizeMem: p toSize: 4294967295U],
OFNoMemException)
/* TODO: Test if freeing object frees all memory */
return 0;
}
|
|
>
>
>
>
>
>
|
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
puts("Trying to allocate more memory than possible...");
CATCH_EXCEPTION(p = [obj getMemWithSize: 4294967295U], OFNoMemException)
puts("Allocating 1 byte...");
p = [obj getMemWithSize: 1];
puts("Trying to resize that 1 byte to more than possible...");
CATCH_EXCEPTION(p = [obj resizeMem: p
toSize: 4294967295U],
OFNoMemException)
puts("Trying to resize NULL to 1024 bytes...");
p = [obj resizeMem: NULL
toSize: 1024];
[obj freeMem: p];
/* TODO: Test if freeing object frees all memory */
return 0;
}
|