]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix problems compiling with memory-management enabled. Ticket #1619. (CVS 2960)
authordanielk1977 <danielk1977@noemail.net>
Mon, 16 Jan 2006 15:32:23 +0000 (15:32 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Mon, 16 Jan 2006 15:32:23 +0000 (15:32 +0000)
FossilOrigin-Name: 36b03259654ffa9b14ebe1093984b29e9efbd56c

manifest
manifest.uuid
src/pager.c
src/test1.c
src/util.c
test/malloc5.test

index b2c539e3e4fc64203e4ece85c351c41e6a0eec5f..45deaab9a5a557230817fb559a5f3d23a89413aa 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\ssome\sof\sthe\sissues\sraised\sin\s#1615.\s(CVS\s2959)
-D 2006-01-16T15:14:27
+C Fix\sproblems\scompiling\swith\smemory-management\senabled.\sTicket\s#1619.\s(CVS\s2960)
+D 2006-01-16T15:32:23
 F Makefile.in ab3ffd8d469cef4477257169b82810030a6bb967
 F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092
 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -59,7 +59,7 @@ F src/os_unix.c 7daa1720d46bbc31c6138462b35876650eb1885e
 F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
 F src/os_win.c cd4ca2753aeaad11f5c9b9b6ef28752f45ed4529
 F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
-F src/pager.c a8ba14f898eaaa529d5463c1a6782e86abfe6cdd
+F src/pager.c e84713f7196a81103cc8e2b55cebbaa1723c4926
 F src/pager.h e0acb095b3ad0bca48f2ab00c87346665643f64f
 F src/parse.y 83df51fea35f68f7e07384d75dce83d1ed30434c
 F src/pragma.c 4496cc77dc35824e1c978c3d1413b8a5a4c777d3
@@ -73,7 +73,7 @@ F src/sqlite.h.in 492580f7e3ff71eb43193eb7bb98e2d549889ce3
 F src/sqliteInt.h 730d071c5272726b5e507ef6d6dd14ccdb2744ae
 F src/table.c 486dcfce532685b53b5a2b5da8bba0ded6fb2316
 F src/tclsqlite.c d650bea0248fc0a310ddc2cb94273a3a5021fddf
-F src/test1.c d21e94ea95e76d8e838792806937332c5693dbf0
+F src/test1.c b138bf5943c3122093b605e2132cacb87f4ea037
 F src/test2.c ca74a1d8aeb7d9606e8f6b762c5daf85c1a3f92b
 F src/test3.c 9742aa146eb750cab81c1d5605286c3a0eb88054
 F src/test4.c 6633cb7b4a7429e938804a34f688d118c8b7f8e1
@@ -85,7 +85,7 @@ F src/tokenize.c 8b694d42b48f22c2037da7e1e716201aaaaa0f3a
 F src/trigger.c 694b247476d2fc0dce003af564f79e8752fc1158
 F src/update.c 261d75c702c2852d1a64274d7c414485e6f2d177
 F src/utf.c 5ab8ca05d4e9ec81174b010f01ab12a232f0087d
-F src/util.c 0d0dc8279d4d0f43eb5d02313b77ab0ffa70f96d
+F src/util.c 60adb2a04e3267f916eba5452bef8688308cad1b
 F src/vacuum.c 21a3c7f6f7be86bb1182fbc3df416ad702435b9e
 F src/vdbe.c 3db9bfc86e71dc0758524fb82cfcfd4c30e92716
 F src/vdbe.h 8729a4ee16ff9aeab2af9667df3cf300ff978e13
@@ -190,7 +190,7 @@ F test/malloc.test 6245418d1b6635a2095d9ed0f5e84e029990da06
 F test/malloc2.test e6e321db96d6c94cb18bf82ad7215070c41e624e
 F test/malloc3.test 265644c655497242f7c0a1bb5b36c8500a5fc27c
 F test/malloc4.test 2e29d155eb4b4808019ef47eeedfcbe9e09e0f05
-F test/malloc5.test 1bac8c0dd98c387460920c1190f0996c5c62ea66
+F test/malloc5.test 7c0a02ab2fef82af6febacc02e033514f1674066
 F test/manydb.test 8de36b8d33aab5ef295b11d9e95310aeded31af8
 F test/memdb.test 1860e060be810bf0775bc57408a5b7c4954bcaea
 F test/memleak.test df2b2b96e77f8ba159a332299535b1e5f18e49ac
@@ -341,7 +341,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b
 F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
-P 9dfc4a880b49869e945d6a19e63fcf6dc94412ad
-R 400c66cf0832b4adf252fe60cc985964
+P 0d5d83bcbd65dd7ae968909acfee075185e49c38
+R 22303cb699131fe98d9532ccd2f42eda
 U danielk1977
-Z 92d6dfb0922d80ce9fab88a62350686e
+Z aea72533a8a2ee1ff7fb69de07973569
index 4daaf9dda903e28b71c6b7446b446156467817c2..ea91a71c1b04d4a678f04a60fc8d4ea8df2febc6 100644 (file)
@@ -1 +1 @@
-0d5d83bcbd65dd7ae968909acfee075185e49c38
\ No newline at end of file
+36b03259654ffa9b14ebe1093984b29e9efbd56c
\ No newline at end of file
index 7034e10d8af775880ba65092ab64145d0d907aed..597e6e0048ce269f27980048c72c2c3222ac2711 100644 (file)
@@ -18,7 +18,7 @@
 ** file simultaneously, or one process from reading the database while
 ** another is writing.
 **
-** @(#) $Id: pager.c,v 1.240 2006/01/16 15:14:28 danielk1977 Exp $
+** @(#) $Id: pager.c,v 1.241 2006/01/16 15:32:23 danielk1977 Exp $
 */
 #ifndef SQLITE_OMIT_DISKIO
 #include "sqliteInt.h"
@@ -1577,7 +1577,7 @@ int sqlite3pager_open(
   int noReadlock = (flags & PAGER_NO_READLOCK)!=0;
   char zTemp[SQLITE_TEMPNAME_SIZE];
 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
-  const ThreadData *pTsdro = sqlite3ThreadDataReadOnly();
+  ThreadData *pTsd = sqlite3ThreadData();
 #endif
 
   /* If malloc() has already failed return SQLITE_NOMEM. Before even
@@ -1680,11 +1680,8 @@ int sqlite3pager_open(
   /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */
   *ppPager = pPager;
 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
-  if( pTsdro->useMemoryManagement ){
-    ThreadData *pTsd = sqlite3ThreadData();
-    pPager->pNext = pTsd->pPager;
-    pTsd->pPager = pPager;
-  }
+  pPager->pNext = pTsd->pPager;
+  pTsd->pPager = pPager;
 #endif
   return SQLITE_OK;
 }
@@ -1988,7 +1985,7 @@ int sqlite3pager_truncate(Pager *pPager, Pgno nPage){
 int sqlite3pager_close(Pager *pPager){
   PgHdr *pPg, *pNext;
 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
-  const ThreadData *pTsd = sqlite3ThreadDataReadOnly();
+  ThreadData *pTsd = sqlite3ThreadData();
 #endif
 
   switch( pPager->state ){
@@ -2051,14 +2048,12 @@ int sqlite3pager_close(Pager *pPager){
   /* Remove the pager from the linked list of pagers starting at 
   ** ThreadData.pPager if memory-management is enabled.
   */
-  if( pTsd->useMemoryManagement ){
-    if( pPager==pTsd->pPager ){
-      pTsd->pPager = pPager->pNext;
-    }else{
-      Pager *pTmp;
-      for(pTmp = pTsd->pPager; pTmp->pNext!=pPager; pTmp=pTmp->pNext);
-      pTmp->pNext = pPager->pNext;
-    }
+  if( pPager==pTsd->pPager ){
+    pTsd->pPager = pPager->pNext;
+  }else{
+    Pager *pTmp;
+    for(pTmp = pTsd->pPager; pTmp->pNext!=pPager; pTmp=pTmp->pNext);
+    pTmp->pNext = pPager->pNext;
   }
 #endif
 
index 5aec16e0065cb3764aedade6dbeeaf03219d112e..684e44d25047b0831489ebef91dd75aa3d63e5cb 100644 (file)
@@ -13,7 +13,7 @@
 ** is not included in the SQLite library.  It is used for automated
 ** testing of the SQLite library.
 **
-** $Id: test1.c,v 1.191 2006/01/15 02:30:58 drh Exp $
+** $Id: test1.c,v 1.192 2006/01/16 15:32:23 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 #include "tcl.h"
@@ -905,7 +905,7 @@ static int sqlite_malloc_outstanding(
 
 #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
   if( objc==2 ){
-    const ThreadData *pTd = sqlite3ThreadDataReadOnly();
+    ThreadData *pTd = sqlite3ThreadData();
     const char *zArg = Tcl_GetString(objv[1]);
     if( 0==strcmp(zArg, "-bytes") ){
       Tcl_SetObjResult(interp, Tcl_NewIntObj(pTd->nAlloc));
index 212f35397dfdab846e317fdbb01452ca3752b54a..da719bd2bd5c7fda07854b1d142f839911ebce59 100644 (file)
@@ -14,7 +14,7 @@
 ** This file contains functions for allocating memory, comparing
 ** strings, and stuff like that.
 **
-** $Id: util.c,v 1.171 2006/01/15 11:39:18 danielk1977 Exp $
+** $Id: util.c,v 1.172 2006/01/16 15:32:23 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 #include "os.h"
@@ -647,11 +647,9 @@ void sqlite3ReallocOrFree(void **pp, int n){
 ** is the number of bytes that were available to SQLite using pointer p, 
 ** regardless of how much memory was actually allocated.
 */
-#if 0          /* This is never actually used */
 int sqlite3AllocSize(void *p){
   return OSSIZEOF(p);
 }
-#endif
 
 /*
 ** Make a copy of a string in memory obtained from sqliteMalloc(). These 
index e62ba12e90e52e590575eb48559e5b0078f33abf..21d3be00b62aba8bd750b7b84d8d4e92dd699857 100644 (file)
@@ -12,7 +12,7 @@
 # This file contains test cases focused on the two memory-management APIs, 
 # sqlite3_soft_heap_limit() and sqlite3_release_memory().
 #
-# $Id: malloc5.test,v 1.5 2006/01/09 09:59:49 danielk1977 Exp $
+# $Id: malloc5.test,v 1.6 2006/01/16 15:32:23 danielk1977 Exp $
 
 #---------------------------------------------------------------------------
 # NOTES ON EXPECTED BEHAVIOUR
@@ -37,7 +37,6 @@ ifcapable !memorymanage {
    return
 }
 
-sqlite3_enable_memory_management 1
 sqlite3 db test.db
 
 do_test malloc5-1.1 {
@@ -219,5 +218,4 @@ sqlite3_soft_heap_limit $::soft_limit
 finish_test
 
 catch {db close}
-sqlite3_enable_memory_management 0