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

Method maxAlloc

src/jrd/pag.cpp:2190–2214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2188}
2189
2190ULONG PageSpace::maxAlloc()
2191{
2192/**************************************
2193 *
2194 * Functional description
2195 * Compute last physically allocated page of database.
2196 *
2197 **************************************/
2198 const USHORT pageSize = dbb->dbb_page_size;
2199 const jrd_file* f = file;
2200 ULONG nPages = PIO_get_number_of_pages(f, pageSize);
2201
2202 while (f->fil_next && nPages == f->fil_max_page - f->fil_min_page + 1 + f->fil_fudge)
2203 {
2204 f = f->fil_next;
2205 nPages = PIO_get_number_of_pages(f, pageSize);
2206 }
2207
2208 nPages += f->fil_min_page - f->fil_fudge;
2209
2210 if (maxPageNumber < nPages)
2211 maxPageNumber = nPages;
2212
2213 return nPages;
2214}
2215
2216ULONG PageSpace::maxAlloc(const Database* dbb)
2217{

Callers 1

extendDatabaseMethod · 0.80

Calls 2

PIO_get_number_of_pagesFunction · 0.85
findPageSpaceMethod · 0.80

Tested by

no test coverage detected