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:
@@ -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
|
||||
|
Reference in New Issue
Block a user