19 #define DBTUP_PAG_MAN_CPP
21 #include <RefConvert.hpp>
22 #include <ndb_limits.h>
104 Uint32 Dbtup::nextHigherTwoLog(Uint32 input)
106 input = input | (input >> 8);
107 input = input | (input >> 4);
108 input = input | (input >> 2);
109 input = input | (input >> 1);
110 Uint32 output = (input & 0x5555) + ((input >> 1) & 0x5555);
111 output = (output & 0x3333) + ((output >> 2) & 0x3333);
112 output = output + (output >> 4);
113 output = (output & 0xf) + ((output >> 8) & 0xf);
117 void Dbtup::initializePage()
121 void Dbtup::allocConsPages(Uint32 noOfPagesToAllocate,
122 Uint32& noOfPagesAllocated,
123 Uint32& allocPageRef)
125 if (noOfPagesToAllocate == 0){
127 noOfPagesAllocated = 0;
131 m_ctx.m_mm.alloc_pages(RT_DBTUP_PAGE, &allocPageRef,
132 &noOfPagesToAllocate, 1);
133 noOfPagesAllocated = noOfPagesToAllocate;
136 m_pages_allocated += noOfPagesAllocated;
137 if (m_pages_allocated > m_pages_allocated_max)
138 m_pages_allocated_max = m_pages_allocated;
143 void Dbtup::returnCommonArea(Uint32 retPageRef, Uint32 retNo)
145 m_ctx.m_mm.release_pages(RT_DBTUP_PAGE, retPageRef, retNo);
148 m_pages_allocated -= retNo;