diff options
author | numist <numist@noemail.net> | 2019-12-12 20:58:32 +0000 |
---|---|---|
committer | numist <numist@noemail.net> | 2019-12-12 20:58:32 +0000 |
commit | 1b47c9c98e9e00bc24d11e6c6cad2c754b05dd02 (patch) | |
tree | c729a273a5e7feaaf2fdfd24054bf716b3e0fbd7 /src/malloc.c | |
parent | c947d6a4dcdfe6f0185a22464cf97153cabb8052 (diff) | |
download | sqlite-1b47c9c98e9e00bc24d11e6c6cad2c754b05dd02.tar.gz sqlite-1b47c9c98e9e00bc24d11e6c6cad2c754b05dd02.zip |
Reduce the number of call sites to dbMallocRawFinish in the case where n > lookaside.sz
FossilOrigin-Name: e392e7f22861ce4b66e4bf84b59c8fd38568fc241a699e001f47fd82011f4d28
Diffstat (limited to 'src/malloc.c')
-rw-r--r-- | src/malloc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/malloc.c b/src/malloc.c index 79cdcbcb2..26a258b34 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -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 |