]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add an assert() to pcache1.c to double-check that page cache buffer memory
authordrh <drh@noemail.net>
Fri, 22 May 2009 11:12:23 +0000 (11:12 +0000)
committerdrh <drh@noemail.net>
Fri, 22 May 2009 11:12:23 +0000 (11:12 +0000)
is never allocated if pcache1 is not enabled.  Ticket #3872 (CVS 6670)

FossilOrigin-Name: 93369d91abe10975507ea9302c145e3ddd0c2c76

manifest
manifest.uuid
src/pcache1.c

index 5d19d3397811dd242356632fb8f3d6bd9cb44fa9..782e5ecafc339d14ce709dd76fd66668cab19d54 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Additional\schanges\sto\spcache1\sto\sprevent\sthe\spage\sbuffer\smemory\sfrom\sbeing\nconfigured\sif\spcache1\sis\snot\senabled.\s\sTicket\s#3872.\s(CVS\s6669)
-D 2009-05-22T11:10:24
+C Add\san\sassert()\sto\spcache1.c\sto\sdouble-check\sthat\spage\scache\sbuffer\smemory\r\nis\snever\sallocated\sif\spcache1\sis\snot\senabled.\s\sTicket\s#3872\s(CVS\s6670)
+D 2009-05-22T11:12:23
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -151,7 +151,7 @@ F src/pager.h 73f481a308a873ccd626d97331c081db3b53e2e5
 F src/parse.y ba2fa210be4b17001e0a16d5e73a8141939b1987
 F src/pcache.c 395f752a13574120bd7513a400ba02a265aaa76d
 F src/pcache.h 9b927ccc5a538e31b4c3bc7eec4f976db42a1324
-F src/pcache1.c 39a2c2fa8329585f1dbe5f2a1fe624b5d78305f2
+F src/pcache1.c bed75f157283e7c666f323df0c874c6a2515f76e
 F src/pragma.c c26c16c49a80d03c8597f0e6c7daba53f283428f
 F src/prepare.c f46d1a029760edee5447e27164fb3ae10e2a6839
 F src/printf.c 3f4dca207a88258d37af5a7a03e800a825fe6456
@@ -729,7 +729,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 6240992cef5cb867d7a638f1906d05aa8efd0652
-R d3ebf1458e7486057052246f1876becc
+P 5153ad19daf0f3b0334b2a06655142899203abbf
+R e695d5320ab4a5af1a8f88d9b5e01a90
 U drh
-Z 75d578e488ac3c2575cd2c0a0971e9ed
+Z 682d221724db391e2f96571715710eeb
index 23c56efa3a6b7f500a2fc263a04f9c8608284a5c..f6ff43637487d49025fc8133c928ebf30eba83df 100644 (file)
@@ -1 +1 @@
-5153ad19daf0f3b0334b2a06655142899203abbf
\ No newline at end of file
+93369d91abe10975507ea9302c145e3ddd0c2c76
\ No newline at end of file
index 76ee2dce478c1468f0b64ad2b00e79e72793093e..b41bb6732598fe19508756fa1aa70f5c1ad375f1 100644 (file)
@@ -16,7 +16,7 @@
 ** If the default page cache implementation is overriden, then neither of
 ** these two features are available.
 **
-** @(#) $Id: pcache1.c,v 1.14 2009/05/22 11:10:24 drh Exp $
+** @(#) $Id: pcache1.c,v 1.15 2009/05/22 11:12:23 drh Exp $
 */
 
 #include "sqliteInt.h"
@@ -155,6 +155,7 @@ static void *pcache1Alloc(int nByte){
   void *p;
   assert( sqlite3_mutex_held(pcache1.mutex) );
   if( nByte<=pcache1.szSlot && pcache1.pFree ){
+    assert( pcache1.isInit );
     p = (PgHdr1 *)pcache1.pFree;
     pcache1.pFree = pcache1.pFree->pNext;
     sqlite3StatusSet(SQLITE_STATUS_PAGECACHE_SIZE, nByte);