| | |
| | | static void *place(void *bp, size_t size); |
| | | static void *find_fit(size_t size); |
| | | static void *coalesce(void *bp); |
| | | static void rm_fblock(void *bp); |
| | | static inline void rm_fblock(void *bp); |
| | | static void insert_fblock (void *bp); |
| | | |
| | | static void *mem_sbrk(int incr); |
| | |
| | | /** |
| | | * remove a block form free list |
| | | */ |
| | | static void rm_fblock(void *rbp) |
| | | static inline void rm_fblock(void *rbp) |
| | | { |
| | | // the successor of the previous block of rbp point to next block of rbp |
| | | // err_msg(0, "SUCCRP(PREV_FBLKP(rbp) %p\n", SUCCRP(PREV_FBLKP(rbp)) ); |
| | | // err_msg(0, "NEXT_FBLKP(rbp)%p\n", NEXT_FBLKP(rbp) ); |
| | | |
| | | PUT_PTR(SUCCRP(PREV_FBLKP(rbp)), NEXT_FBLKP(rbp)); |
| | | // the predecessor of then next block of rbp point to previous block of rbp |
| | | PUT_PTR(PREDRP(NEXT_FBLKP(rbp)), PREV_FBLKP(rbp)); |