8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 18:43:02 +01:00

Fix alignment incompatibility between 32-bit and 64-bit builds. Partially sync with the tablespace branch to simplify merging the code later.

This commit is contained in:
Dmitry Yemanov 2025-01-20 10:45:37 +03:00
parent 428dd182f8
commit fefe8c1769

View File

@ -365,7 +365,9 @@ struct index_root_page
{ {
pag irt_header; pag irt_header;
USHORT irt_relation; // relation id (for consistency) USHORT irt_relation; // relation id (for consistency)
USHORT irt_count; // Number of indices USHORT irt_count; // number of indices
ULONG irt_unused; // so far used as a padding to ensure the same
// alignment between 32-bit and 64-bit builds
struct irt_repeat struct irt_repeat
{ {
friend class index_root_page; // to allow offset check for private members friend class index_root_page; // to allow offset check for private members
@ -373,7 +375,11 @@ struct index_root_page
union union
{ {
FB_UINT64 irt_transaction; // transaction in progress FB_UINT64 irt_transaction; // transaction in progress
ULONG irt_root; // page number of index root struct
{
ULONG irt_page_num; // page number
ULONG irt_page_space_id; // page space
} irt_root; // index root page
}; };
public: public:
USHORT irt_desc; // offset to key descriptions USHORT irt_desc; // offset to key descriptions
@ -429,13 +435,13 @@ inline constexpr USHORT irt_condition = 64;
inline bool index_root_page::irt_repeat::isUsed() const inline bool index_root_page::irt_repeat::isUsed() const
{ {
return (irt_flags & irt_in_progress) || (irt_root != 0); return (irt_flags & irt_in_progress) || (irt_root.irt_page_num != 0);
} }
inline void index_root_page::irt_repeat::setEmpty() inline void index_root_page::irt_repeat::setEmpty()
{ {
irt_transaction = 0; irt_transaction = 0;
fb_assert(irt_root == 0); fb_assert(irt_root.irt_page_num == 0 && irt_root.irt_page_space_id == 0);
irt_flags = 0; irt_flags = 0;
} }
@ -452,12 +458,13 @@ inline void index_root_page::irt_repeat::setInProgress(TraNumber traNumber)
inline ULONG index_root_page::irt_repeat::getRoot() const inline ULONG index_root_page::irt_repeat::getRoot() const
{ {
return (irt_flags & irt_in_progress) ? 0 : irt_root; return (irt_flags & irt_in_progress) ? 0 : irt_root.irt_page_num;
} }
inline void index_root_page::irt_repeat::setRoot(ULONG rootPage) inline void index_root_page::irt_repeat::setRoot(ULONG rootPage)
{ {
irt_root = rootPage; irt_root.irt_page_num = rootPage;
irt_root.irt_page_space_id = 0;
irt_flags &= ~irt_in_progress; irt_flags &= ~irt_in_progress;
} }