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

Function recoverMalloc

modules/dasSQLITE/sqlite/shell.c:13794–13806  ·  view source on GitHub ↗

** This function is a no-op if the recover handle passed as the first ** argument already contains an error (if p->errCode!=SQLITE_OK). ** ** Otherwise, an attempt is made to allocate, zero and return a buffer nByte ** bytes in size. If successful, a pointer to the new buffer is returned. Or, ** if an OOM error occurs, NULL is returned and the handle error code ** (p->errCode) set to SQLITE_NOME

Source from the content-addressed store, hash-verified

13792** (p->errCode) set to SQLITE_NOMEM.
13793*/
13794static void *recoverMalloc(sqlite3_recover *p, i64 nByte){
13795 void *pRet = 0;
13796 assert( nByte>0 );
13797 if( p->errCode==SQLITE_OK ){
13798 pRet = sqlite3_malloc64(nByte);
13799 if( pRet ){
13800 memset(pRet, 0, nByte);
13801 }else{
13802 p->errCode = SQLITE_NOMEM;
13803 }
13804 }
13805 return pRet;
13806}
13807
13808/*
13809** Set the error code and error message for the recover handle passed as

Callers 5

recoverBitmapAllocFunction · 0.85
recoverAddTableFunction · 0.85
recoverLostAndFound3InitFunction · 0.85
recoverWriteDataInitFunction · 0.85
recoverVfsReadFunction · 0.85

Calls 1

assertFunction · 0.85

Tested by

no test coverage detected