1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Reduce the number of call sites to dbMallocRawFinish in the case where n > lookaside.sz

FossilOrigin-Name: e392e7f22861ce4b66e4bf84b59c8fd38568fc241a699e001f47fd82011f4d28
This commit is contained in:
numist
2019-12-12 20:58:32 +00:00
parent c947d6a4dc
commit 1b47c9c98e
3 changed files with 11 additions and 10 deletions

View File

@@ -578,10 +578,11 @@ void *sqlite3DbMallocRawNN(sqlite3 *db, u64 n){
assert( sqlite3_mutex_held(db->mutex) );
assert( db->pnBytesFreed==0 );
if( n>db->lookaside.sz ){
if( db->lookaside.bDisable ){
return db->mallocFailed ? 0 : dbMallocRawFinish(db, n);
if( !db->lookaside.bDisable ){
db->lookaside.anStat[1]++;
}else if( db->mallocFailed ){
return 0;
}
db->lookaside.anStat[1]++;
return dbMallocRawFinish(db, n);
}
# ifndef SQLITE_OMIT_MINI_LOOKASIDE