Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.09 KB | None | 0 0
  1. int main()
  2. {
  3.     int* test[20];
  4.     int i = 0;
  5.     //All possible two blocks test
  6.     printf("\n Test %d", i++);
  7.     test[0]=(int*)MyMalloc(12484);
  8.     test[1]=(int*)MyMalloc(12484);
  9.     MyFree(test[0]);
  10.     MyFree(test[1]);
  11.  
  12.     test[0]=(int*)MyMalloc(24984);
  13.     MyFree(test[0]);
  14.  
  15.     test[0]=(int*)MyMalloc(12484);
  16.     test[1]=(int*)MyMalloc(12484);
  17.     MyFree(test[1]);
  18.     MyFree(test[0]);
  19.  
  20.     test[0]=(int*)MyMalloc(24984);
  21.     MyFree(test[0]);
  22.  
  23.     //All possible four blocks test
  24.     test[0]=(int*)MyMalloc(6234);
  25.     test[1]=(int*)MyMalloc(6234);
  26.     test[2]=(int*)MyMalloc(6234);
  27.     test[3]=(int*)MyMalloc(6234);
  28.     MyFree(test[0]);
  29.     MyFree(test[1]);
  30.     MyFree(test[2]);
  31.     MyFree(test[3]);
  32.  
  33.     test[0]=(int*)MyMalloc(24984);
  34.     MyFree(test[0]);
  35.    
  36.     test[0]=(int*)MyMalloc(6234);
  37.     test[1]=(int*)MyMalloc(6234);
  38.     test[2]=(int*)MyMalloc(6234);
  39.     test[3]=(int*)MyMalloc(6234);
  40.     MyFree(test[1]);
  41.     MyFree(test[0]);
  42.     MyFree(test[3]);
  43.     MyFree(test[2]);
  44.  
  45.     test[0]=(int*)MyMalloc(24984);
  46.     MyFree(test[0]);
  47.    
  48.     test[0]=(int*)MyMalloc(6234);
  49.     test[1]=(int*)MyMalloc(6234);
  50.     test[2]=(int*)MyMalloc(6234);
  51.     test[3]=(int*)MyMalloc(6234);
  52.     MyFree(test[3]);
  53.     MyFree(test[2]);
  54.     MyFree(test[0]);
  55.     MyFree(test[1]);
  56.  
  57.     test[0]=(int*)MyMalloc(24984);
  58.     MyFree(test[0]);
  59.    
  60.     test[0]=(int*)MyMalloc(6234);
  61.     test[1]=(int*)MyMalloc(6234);
  62.     test[2]=(int*)MyMalloc(6234);
  63.     test[3]=(int*)MyMalloc(6234);
  64.     MyFree(test[2]);
  65.     MyFree(test[0]);
  66.     MyFree(test[1]);
  67.     MyFree(test[3]);
  68.    
  69.  
  70.     test[0]=(int*)MyMalloc(24984);
  71.     MyFree(test[0]);
  72.    
  73.     //something
  74.     test[0]=(int*)MyMalloc(6234);
  75.     test[1]=(int*)MyMalloc(6234);
  76.     test[2]=(int*)MyMalloc(6234);
  77.     test[3]=(int*)MyMalloc(2070);
  78.     test[4]=(int*)MyMalloc(2066);
  79.     test[5]=(int*)MyMalloc(2066);
  80.     MyFree(test[2]);
  81.     MyFree(test[0]);
  82.     MyFree(test[1]);
  83.     MyFree(test[5]);
  84.     MyFree(test[3]);
  85.     MyFree(test[4]);
  86.  
  87.  
  88.     test[0]=(int*)MyMalloc(24984);
  89.     MyFree(test[0]);
  90.     return 0;
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement