Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- int* test[20];
- int i = 0;
- //All possible two blocks test
- printf("\n Test %d", i++);
- test[0]=(int*)MyMalloc(12484);
- test[1]=(int*)MyMalloc(12484);
- MyFree(test[0]);
- MyFree(test[1]);
- test[0]=(int*)MyMalloc(24984);
- MyFree(test[0]);
- test[0]=(int*)MyMalloc(12484);
- test[1]=(int*)MyMalloc(12484);
- MyFree(test[1]);
- MyFree(test[0]);
- test[0]=(int*)MyMalloc(24984);
- MyFree(test[0]);
- //All possible four blocks test
- test[0]=(int*)MyMalloc(6234);
- test[1]=(int*)MyMalloc(6234);
- test[2]=(int*)MyMalloc(6234);
- test[3]=(int*)MyMalloc(6234);
- MyFree(test[0]);
- MyFree(test[1]);
- MyFree(test[2]);
- MyFree(test[3]);
- test[0]=(int*)MyMalloc(24984);
- MyFree(test[0]);
- test[0]=(int*)MyMalloc(6234);
- test[1]=(int*)MyMalloc(6234);
- test[2]=(int*)MyMalloc(6234);
- test[3]=(int*)MyMalloc(6234);
- MyFree(test[1]);
- MyFree(test[0]);
- MyFree(test[3]);
- MyFree(test[2]);
- test[0]=(int*)MyMalloc(24984);
- MyFree(test[0]);
- test[0]=(int*)MyMalloc(6234);
- test[1]=(int*)MyMalloc(6234);
- test[2]=(int*)MyMalloc(6234);
- test[3]=(int*)MyMalloc(6234);
- MyFree(test[3]);
- MyFree(test[2]);
- MyFree(test[0]);
- MyFree(test[1]);
- test[0]=(int*)MyMalloc(24984);
- MyFree(test[0]);
- test[0]=(int*)MyMalloc(6234);
- test[1]=(int*)MyMalloc(6234);
- test[2]=(int*)MyMalloc(6234);
- test[3]=(int*)MyMalloc(6234);
- MyFree(test[2]);
- MyFree(test[0]);
- MyFree(test[1]);
- MyFree(test[3]);
- test[0]=(int*)MyMalloc(24984);
- MyFree(test[0]);
- //something
- test[0]=(int*)MyMalloc(6234);
- test[1]=(int*)MyMalloc(6234);
- test[2]=(int*)MyMalloc(6234);
- test[3]=(int*)MyMalloc(2070);
- test[4]=(int*)MyMalloc(2066);
- test[5]=(int*)MyMalloc(2066);
- MyFree(test[2]);
- MyFree(test[0]);
- MyFree(test[1]);
- MyFree(test[5]);
- MyFree(test[3]);
- MyFree(test[4]);
- test[0]=(int*)MyMalloc(24984);
- MyFree(test[0]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement