Enabled compactPage in TallocFromPage()

This commit is contained in:
Sears Russell 2005-03-24 11:04:06 +00:00
parent 4c1ca194d0
commit 08ceca11ce
2 changed files with 14 additions and 6 deletions

View file

@ -216,9 +216,17 @@ compensated_function recordid TallocFromPage(int xid, long page, long size) {
if(rid.size == size) { if(rid.size == size) {
Tupdate(xid,rid, NULL, OPERATION_ALLOC); Tupdate(xid,rid, NULL, OPERATION_ALLOC);
} else { } else {
// slottedCompact(p); 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); assert(rid.size < 0);
} }
}
if(p) { if(p) {
/* @todo alloc.c pins multiple pages -> Will deadlock with small buffer sizes.. */ /* @todo alloc.c pins multiple pages -> Will deadlock with small buffer sizes.. */
releasePage(p); releasePage(p);

View file

@ -75,13 +75,13 @@ void slottedCompact(Page * page) {
truncate the list before continuing. */ truncate the list before continuing. */
short next = *freelist_ptr(page); short next = *freelist_ptr(page);
while(next >= numSlots) { while(next >= numSlots && next != INVALID_SLOT) {
next = *slot_length_ptr(page, next); next = *slot_length_ptr(page, next);
} }
*freelist_ptr(page) = next; *freelist_ptr(page) = next;
/* Rebuild the freelist. */ // Rebuild the freelist.
/* *freelist_ptr(&bufPage) = 0; /* *freelist_ptr(&bufPage) = 0;
for (i = 0; i < numSlots; i++) { for (i = 0; i < numSlots; i++) {
@ -90,8 +90,8 @@ void slottedCompact(Page * page) {
*freelist_ptr(&bufPage) = i; *freelist_ptr(&bufPage) = i;
break; break;
} }
} } */
*/
memcpy(page->memAddr, buffer, PAGE_SIZE); memcpy(page->memAddr, buffer, PAGE_SIZE);
} }