Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct chunk* get_chunk(void *p)
- {
- if(p == NULL)
- return NULL;
- /*if((char*)p % sizeof(size_t) != 0)
- return NULL;*/
- struct chunk *base = get_base();
- /* if((struct chunk*)p < base || p > sbrk(0))
- return NULL;*/
- while(base != NULL && base->data != p)
- {
- base = base->next;
- }
- if(base == NULL || base->free == 0)
- return NULL;
- return base;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement