From 2f2ec71cd41188463f2c704a53bca79f49b96fd5 Mon Sep 17 00:00:00 2001 From: dimitr Date: Fri, 23 Mar 2007 11:35:37 +0000 Subject: [PATCH] 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. --- src/jrd/blb.cpp | 14 +++++++++----- src/jrd/blb.h | 10 ---------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/jrd/blb.cpp b/src/jrd/blb.cpp index 976055ee0a..bf31d76fcb 100644 --- a/src/jrd/blb.cpp +++ b/src/jrd/blb.cpp @@ -312,7 +312,7 @@ void BLB_garbage_collect( **************************************/ SET_TDBB(tdbb); - Firebird::SparseBitmap 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()); diff --git a/src/jrd/blb.h b/src/jrd/blb.h index eda6193608..91dde0f44a 100644 --- a/src/jrd/blb.h +++ b/src/jrd/blb.h @@ -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);