place(void *bp, size_t asize): differenct case for last sizeclass
parent
2a4dd8d48d
commit
995701749f
10
mm.c
10
mm.c
|
@ -133,6 +133,14 @@ static void* extend_heap(size_t words);
|
|||
static void place(void *bp, size_t asize)
|
||||
{
|
||||
size_t csize = GET_SIZE(HDRP(bp));
|
||||
|
||||
if (asize <= (2*(1 << (LISTSIZE-1)))) {
|
||||
PUT(HDRP(bp), PACK(csize, 1));
|
||||
PUT(FTRP(bp), PACK(csize, 1));
|
||||
} else {
|
||||
// Sonderfall 10
|
||||
}
|
||||
|
||||
if ((csize - asize) >= (2*DSIZE)) {
|
||||
PUT(HDRP(bp), PACK(asize, 1));
|
||||
PUT(FTRP(bp), PACK(asize, 1));
|
||||
|
@ -141,8 +149,6 @@ static void place(void *bp, size_t asize)
|
|||
PUT(FTRP(bp), PACK(csize-asize, 0));
|
||||
}
|
||||
else {
|
||||
PUT(HDRP(bp), PACK(csize, 1));
|
||||
PUT(FTRP(bp), PACK(csize, 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue