MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / recoverBitmapAlloc

Function recoverBitmapAlloc

modules/dasSQLITE/sqlite/shell.c:13848–13857  ·  view source on GitHub ↗

** This function is a no-op if p->errCode is initially other than SQLITE_OK. ** In this case it returns NULL. ** ** Otherwise, an attempt is made to allocate and return a bitmap object ** large enough to store a bit for all page numbers between 1 and nPg, ** inclusive. The bitmap is initially zeroed. */

Source from the content-addressed store, hash-verified

13846** inclusive. The bitmap is initially zeroed.
13847*/
13848static RecoverBitmap *recoverBitmapAlloc(sqlite3_recover *p, i64 nPg){
13849 int nElem = (nPg+1+31) / 32;
13850 int nByte = sizeof(RecoverBitmap) + nElem*sizeof(u32);
13851 RecoverBitmap *pRet = (RecoverBitmap*)recoverMalloc(p, nByte);
13852
13853 if( pRet ){
13854 pRet->nPg = nPg;
13855 }
13856 return pRet;
13857}
13858
13859/*
13860** Free a bitmap object allocated by recoverBitmapAlloc().

Callers 1

recoverLostAndFound1InitFunction · 0.85

Calls 1

recoverMallocFunction · 0.85

Tested by

no test coverage detected