MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / getJumpNodeSize

Method getJumpNodeSize

src/jrd/btn.cpp:126–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124
125
126USHORT IndexJumpNode::getJumpNodeSize() const
127{
128/**************************************
129 *
130 * g e t J u m p N o d e S i z e
131 *
132 **************************************
133 *
134 * Functional description
135 * Return the size needed to store
136 * this node.
137 *
138 **************************************/
139 USHORT result = 0;
140
141 // Size needed for prefix
142 USHORT number = prefix;
143 if (number & 0xC000) {
144 result += 3;
145 }
146 else if (number & 0xFF80) {
147 result += 2;
148 }
149 else {
150 result += 1;
151 }
152
153 // Size needed for length
154 number = length;
155 if (number & 0xC000) {
156 result += 3;
157 }
158 else if (number & 0xFF80) {
159 result += 2;
160 }
161 else {
162 result += 1;
163 }
164
165 // Size needed for offset
166 // NOTE! offset can be unknown when this function is called,
167 // therefor we can't use a compression method.
168 result += sizeof(USHORT);
169 // Size needed for data
170 result += length;
171 return result;
172}
173
174
175USHORT IndexNode::getNodeSize(bool leafNode) const

Callers 5

walk_indexMethod · 0.80
delete_nodeFunction · 0.80
fast_loadFunction · 0.80
generate_jump_nodesFunction · 0.80
insert_nodeFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected