summaryrefslogtreecommitdiffstats
path: root/lib/libsqlite3/src/pcache1.c
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2012-06-22 17:48:15 +0000
committerespie <espie@openbsd.org>2012-06-22 17:48:15 +0000
commitf59b59d8f0f4d9c9dc517727087c56fa3b94838f (patch)
treed51be9cb4ac356c69faa75e0f255f1ba7857afb5 /lib/libsqlite3/src/pcache1.c
parentAdd initial support for retransmition timeouts and response retries. (diff)
downloadwireguard-openbsd-f59b59d8f0f4d9c9dc517727087c56fa3b94838f.tar.xz
wireguard-openbsd-f59b59d8f0f4d9c9dc517727087c56fa3b94838f.zip
import 3.7.13
okay jasper@
Diffstat (limited to 'lib/libsqlite3/src/pcache1.c')
-rw-r--r--lib/libsqlite3/src/pcache1.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libsqlite3/src/pcache1.c b/lib/libsqlite3/src/pcache1.c
index 42fc8ceba9c..c41b49e6c86 100644
--- a/lib/libsqlite3/src/pcache1.c
+++ b/lib/libsqlite3/src/pcache1.c
@@ -212,12 +212,14 @@ static void *pcache1Alloc(int nByte){
** it from sqlite3Malloc instead.
*/
p = sqlite3Malloc(nByte);
+#ifndef SQLITE_DISABLE_PAGECACHE_OVERFLOW_STATS
if( p ){
int sz = sqlite3MallocSize(p);
sqlite3_mutex_enter(pcache1.mutex);
sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_OVERFLOW, sz);
sqlite3_mutex_leave(pcache1.mutex);
}
+#endif
sqlite3MemdebugSetType(p, MEMTYPE_PCACHE);
}
return p;
@@ -244,9 +246,11 @@ static int pcache1Free(void *p){
assert( sqlite3MemdebugHasType(p, MEMTYPE_PCACHE) );
sqlite3MemdebugSetType(p, MEMTYPE_HEAP);
nFreed = sqlite3MallocSize(p);
+#ifndef SQLITE_DISABLE_PAGECACHE_OVERFLOW_STATS
sqlite3_mutex_enter(pcache1.mutex);
sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_OVERFLOW, -nFreed);
sqlite3_mutex_leave(pcache1.mutex);
+#endif
sqlite3_free(p);
}
return nFreed;