simple_allocator

A simple, poorly-performing memory allocator
git clone https://git.bracken.jp/simple_allocator.git
Log | Files | Refs | Submodules | README | LICENSE

main.c (344B)


      1 #include <stdio.h>
      2 
      3 #include "memory.h"
      4 
      5 int main(int argc, char** argv) {
      6   print_brk();
      7   print_alloc_list();
      8   printf("\n");
      9 
     10   void *p = malloc(20);
     11   printf("*** malloced a block\n");
     12   print_block(p);
     13   print_brk();
     14   print_alloc_list();
     15   printf("\n");
     16 
     17   free(p);
     18   printf("*** freed a block\n");
     19   print_brk();
     20   print_alloc_list();
     21 }