8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 00:03:03 +01:00

An alternative attempt to fix the alignment issue. We don't need to track the entire blob_id, the record number part is enough. Hence there's no need to read the whole blob_id as int64.

Discussed with Vlad and Alex, tested on SPARC.
This commit is contained in:
dimitr 2007-03-23 11:35:37 +00:00
parent d5ab5ec85b
commit 2f2ec71cd4
2 changed files with 9 additions and 15 deletions

View File

@ -312,7 +312,7 @@ void BLB_garbage_collect(
**************************************/
SET_TDBB(tdbb);
Firebird::SparseBitmap<UINT64> bmGoing;
RecordBitmap bmGoing;
ULONG cntGoing = 0;
// Loop thru records on the way out looking for blobs to garbage collect
@ -331,7 +331,8 @@ void BLB_garbage_collect(
EVL_field(0, rec, id, &desc))
{
const bid* blob = (bid*) desc.dsc_address;
bmGoing.set(blob->getInt64());
const RecordNumber number = blob->get_permanent_number();
bmGoing.set(number.getValue());
cntGoing++;
}
}
@ -355,9 +356,10 @@ void BLB_garbage_collect(
EVL_field(0, rec, id, &desc))
{
const bid* blob = (bid*) desc.dsc_address;
if (bmGoing.test(blob->getInt64()))
const RecordNumber number = blob->get_permanent_number();
if (bmGoing.test(number.getValue()))
{
bmGoing.clear(blob->getInt64());
bmGoing.clear(number.getValue());
if (!--cntGoing)
return;
}
@ -368,8 +370,10 @@ void BLB_garbage_collect(
// Get rid of blob
if (bmGoing.getFirst()) {
do {
const UINT64 id = bmGoing.current();
bid blob;
blob.setInt64(bmGoing.current());
blob.set_permanent(relation->rel_id, RecordNumber(id));
delete_blob_id(tdbb, &blob, prior_page, relation);
} while (bmGoing.getNext());

View File

@ -62,16 +62,6 @@ struct bid {
} bid_quad;
};
void setInt64(UINT64 value) {
memcpy(this, &value, sizeof *this);
}
UINT64 getInt64() const {
UINT64 value;
memcpy(&value, this, sizeof value);
return value;
}
ULONG& bid_temp_id() {
// Make sure that compiler packed structure like we wanted
fb_assert(sizeof(*this) == 8);