Guest User

Untitled

a guest
Apr 23rd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include <unistd.h>
  2. #include "allocator.h"
  3.  
  4. struct mem_cell {
  5.     int *address;
  6.     int *size;
  7.     char *identifier;
  8. };
  9.  
  10.  
  11. struct mem_cell memory[MEM_SIZE];
  12. int elements = MEM_SIZE / sizeof(struct mem_cell);
  13.  
  14.  
  15. void print_memory_map() {
  16.  
  17.     printf("memory_map: ");int i;int j;
  18.     for(i = 0; i <= MEM_SIZE; i++) {
  19.         if (memory[i] != NULL) {
  20.             for (j = 0; j <= memory[j]->size; j++) {
  21.                 printf("%c", memory[i]->identifier);
  22.             }
  23.         } else {
  24.             printf("%d", 0);
  25.         }
  26.     }
  27.     printf("\n");
  28. }
Add Comment
Please, Sign In to add comment