Enabled compactPage in TallocFromPage()
This commit is contained in:
parent
4c1ca194d0
commit
08ceca11ce
2 changed files with 14 additions and 6 deletions
|
@ -216,8 +216,16 @@ compensated_function recordid TallocFromPage(int xid, long page, long size) {
|
|||
if(rid.size == size) {
|
||||
Tupdate(xid,rid, NULL, OPERATION_ALLOC);
|
||||
} else {
|
||||
// slottedCompact(p);
|
||||
assert(rid.size < 0);
|
||||
p = loadPage(xid, page);
|
||||
slottedCompact(p);
|
||||
releasePage(p);
|
||||
p = NULL;
|
||||
rid = slottedPreRallocFromPage(xid, page, size, &p);
|
||||
if(rid.size == size) {
|
||||
Tupdate(xid,rid, NULL, OPERATION_ALLOC);
|
||||
} else {
|
||||
assert(rid.size < 0);
|
||||
}
|
||||
}
|
||||
if(p) {
|
||||
/* @todo alloc.c pins multiple pages -> Will deadlock with small buffer sizes.. */
|
||||
|
|
|
@ -75,13 +75,13 @@ void slottedCompact(Page * page) {
|
|||
truncate the list before continuing. */
|
||||
|
||||
short next = *freelist_ptr(page);
|
||||
while(next >= numSlots) {
|
||||
while(next >= numSlots && next != INVALID_SLOT) {
|
||||
next = *slot_length_ptr(page, next);
|
||||
}
|
||||
|
||||
*freelist_ptr(page) = next;
|
||||
|
||||
/* Rebuild the freelist. */
|
||||
// Rebuild the freelist.
|
||||
|
||||
/* *freelist_ptr(&bufPage) = 0;
|
||||
for (i = 0; i < numSlots; i++) {
|
||||
|
@ -90,8 +90,8 @@ void slottedCompact(Page * page) {
|
|||
*freelist_ptr(&bufPage) = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
} */
|
||||
|
||||
|
||||
memcpy(page->memAddr, buffer, PAGE_SIZE);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue