]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Another memory allocator performance optimization.
authordrh <drh@noemail.net>
Sat, 23 Aug 2014 19:42:06 +0000 (19:42 +0000)
committerdrh <drh@noemail.net>
Sat, 23 Aug 2014 19:42:06 +0000 (19:42 +0000)
FossilOrigin-Name: 6da6f46d0c43e3b68c21f514ddf8ee663c20f249

manifest
manifest.uuid
src/malloc.c

index f86063d01b5c5097c7c8c03fc740d5cdf6eeea85..0f001ae399aa1a0bba36112983a68a55d8f07edf 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sa\svariable-declaration\safter\scode\sproblem\sin\sbtree.c.\s\sHarmless\sin\nGCC\sand\sCLANG\sbut\sunacceptable\sfor\sMSVC.
-D 2014-08-23T19:08:09.445
+C Another\smemory\sallocator\sperformance\soptimization.
+D 2014-08-23T19:42:06.737
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 5eb79e334a5de69c87740edd56af6527dd219308
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -191,7 +191,7 @@ F src/legacy.c 87c92f4a08e2f70220e3b22a9c3b2482d36a134a
 F src/lempar.c cdf0a000315332fc9b50b62f3b5e22e080a0952b
 F src/loadext.c 31c2122b7dd05a179049bbf163fd4839f181cbab
 F src/main.c 900dd06e41d22795cbb23ab0240397f1e2901bf7
-F src/malloc.c 7f26fcedc42b93bb49c4c12a77aa0d891182392e
+F src/malloc.c 06f8507831d04d2830237bf0c9f2fd04623f9868
 F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
 F src/mem1.c c0c990fcaddff810ea277b4fb5d9138603dd5d4b
 F src/mem2.c dce31758da87ec2cfa52ba4c5df1aed6e07d8e8f
@@ -1188,7 +1188,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P f83daa16f65ef35062412e88c214852a4aeb3da2
-R 964769625a1b08555f23e3f40e4e1b01
+P 45abd5c0bad2847861f3b26a7040490aa9bb1332
+R 863f9a5c456ee79d86d610ec7db424be
 U drh
-Z 8bbf37cac5a7f4ae4955d0f942660ce9
+Z 2076d0986bc3817907a655695f4a8b4e
index 948c00a1947393eb8997c8c10e36d7aee920bd5e..7e569bfcb7dbe829e2842eabf5c65c4a521e371d 100644 (file)
@@ -1 +1 @@
-45abd5c0bad2847861f3b26a7040490aa9bb1332
\ No newline at end of file
+6da6f46d0c43e3b68c21f514ddf8ee663c20f249
\ No newline at end of file
index f3b317da5ffdd7eec1e0dd80ddc911b6020bcccd..1b219604bc2fed56cb8be1dae634965bbcf626cb 100644 (file)
@@ -477,6 +477,14 @@ void sqlite3_free(void *p){
   }
 }
 
+/*
+** Add the size of memory allocation "p" to the count in
+** *db->pnBytesFreed.
+*/
+static SQLITE_NOINLINE void measureAllocationSize(sqlite3 *db, void *p){
+  *db->pnBytesFreed += sqlite3DbMallocSize(db,p);
+}
+
 /*
 ** Free memory that might be associated with a particular database
 ** connection.
@@ -486,7 +494,7 @@ void sqlite3DbFree(sqlite3 *db, void *p){
   if( p==0 ) return;
   if( db ){
     if( db->pnBytesFreed ){
-      *db->pnBytesFreed += sqlite3DbMallocSize(db, p);
+      measureAllocationSize(db, p);
       return;
     }
     if( isLookaside(db, p) ){