daily pastebin goal
55%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. struct chunk* get_chunk(void *p)
  2. {
  3.     if(p == NULL)
  4.         return NULL;
  5.     /*if((char*)p % sizeof(size_t) != 0)
  6.         return NULL;*/
  7.     struct chunk *base = get_base();
  8.     /* if((struct chunk*)p < base || p > sbrk(0))
  9.         return NULL;*/
  10.     while(base != NULL && base->data != p)
  11.     {
  12.         base = base->next;
  13.     }
  14.     if(base == NULL || base->free == 0)
  15.         return NULL;
  16.     return base;
  17.  
  18. }
RAW Paste Data
Top