diff options
-rw-r--r-- | src/tlsf.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -438,7 +438,7 @@ tlsf_add_area(tlsf_t* tlsf, void *area, size_t area_size) b1 = GET_NEXT_BLOCK(ib1->ptr.buffer, ib1->size & BLOCK_SIZE); lb1 = ptr->end; - /* Merging the new area with the next physically contigous one */ + /* Merge the new area with the next physically contiguous one */ if ((unsigned long) ib1 == (unsigned long) lb0 + BHDR_OVERHEAD) { if (tlsf->area_head == ptr) { tlsf->area_head = ptr->next; @@ -449,8 +449,9 @@ tlsf_add_area(tlsf_t* tlsf, void *area, size_t area_size) } b0->size = - ROUNDDOWN_SIZE((b0->size & BLOCK_SIZE) + - (ib1->size & BLOCK_SIZE) + 2 * BHDR_OVERHEAD) | USED_BLOCK | PREV_USED; + ROUNDDOWN_SIZE((b0->size & BLOCK_SIZE) + (ib1->size & BLOCK_SIZE) + + 2 * BHDR_OVERHEAD) + | USED_BLOCK | PREV_USED; b1->prev_hdr = b0; lb0 = lb1; @@ -458,7 +459,7 @@ tlsf_add_area(tlsf_t* tlsf, void *area, size_t area_size) continue; } - /* Merge the new area with the previous physically contigous one */ + /* Merge the new area with the previous physically contiguous one */ if ((unsigned long) lb1->ptr.buffer == (unsigned long) ib0) { if (tlsf->area_head == ptr) { tlsf->area_head = ptr->next; @@ -469,8 +470,9 @@ tlsf_add_area(tlsf_t* tlsf, void *area, size_t area_size) } lb1->size = - ROUNDDOWN_SIZE((b0->size & BLOCK_SIZE) + - (ib0->size & BLOCK_SIZE) + 2 * BHDR_OVERHEAD) | USED_BLOCK | (lb1->size & PREV_STATE); + ROUNDDOWN_SIZE((b0->size & BLOCK_SIZE) + (ib0->size & BLOCK_SIZE) + + 2 * BHDR_OVERHEAD) + | USED_BLOCK | (lb1->size & PREV_STATE); next_b = GET_NEXT_BLOCK(lb1->ptr.buffer, lb1->size & BLOCK_SIZE); next_b->prev_hdr = lb1; b0 = lb1; |