From e1935f236760af9532ce0f674dd2be09ea4886f5 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 19 Feb 2009 20:50:14 +0000 Subject: [PATCH] Remove code in malloc.c that was already commented out using #if 0. (CVS 6306) FossilOrigin-Name: e1ad757ec0abead25265f9251c954d2497bccc06 --- manifest | 14 ++++---- manifest.uuid | 2 +- src/malloc.c | 91 +-------------------------------------------------- 3 files changed, 9 insertions(+), 98 deletions(-) diff --git a/manifest b/manifest index 6fea4d19d7..54acc19fb6 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Changes\sto\sreduce\sthe\sheap\sspace\sconsumed\sby\striggers,\sviews\sand\stables\sin\sthe\sin-memory\srepresentation\sof\sthe\sschema.\sAlso\sto\sreduce\sthe\sspace\sused\sby\sprepared\sstatements\sslightly.\s(CVS\s6305) -D 2009-02-19T14:39:25 +C Remove\scode\sin\smalloc.c\sthat\swas\salready\scommented\sout\susing\s#if\s0.\s(CVS\s6306) +D 2009-02-19T20:50:15 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 1d83fa2b1fd326b9e121012bd1ff9740537e12b3 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -124,7 +124,7 @@ F src/journal.c e00df0c0da8413ab6e1bb7d7cab5665d4a9000d0 F src/legacy.c 8b3b95d48d202614946d7ce7256e7ba898905c3b F src/loadext.c 3f96631089fc4f3871a67f02f2e4fc7ea4d51edc F src/main.c 4912460dab29e4d37e4ba1d78320c6a77bb95ad8 -F src/malloc.c 552d993ee414ead65cafcaa636e22c84085999cb +F src/malloc.c 072ddad9b7e908e9b9a2a494d4758dadeced61ae F src/mem0.c f2f84062d1f35814d6535c9f9e33de3bfb3b132c F src/mem1.c 3bfb39e4f60b0179713a7c087b2d4f0dc205735f F src/mem2.c 692c5b50141f49c32d85d7c0c39c751f6d520093 @@ -701,7 +701,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P ded04f12f41504e4a3ecd5164f0d4cbbde5e16f7 -R beea4442dc6507223c6db2a960f9f40a -U danielk1977 -Z 5a9e5027f061557095d1ee54ae664ed7 +P d9f6ffbc5ea090ba0daac571fc9a6c68b9c864e4 +R 71113436f434e40594eca0b6cc7e07b2 +U drh +Z 7f8f808d7025e6cd7278ce47c4e4464a diff --git a/manifest.uuid b/manifest.uuid index 8536c32b9b..a1399f21be 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d9f6ffbc5ea090ba0daac571fc9a6c68b9c864e4 \ No newline at end of file +e1ad757ec0abead25265f9251c954d2497bccc06 \ No newline at end of file diff --git a/src/malloc.c b/src/malloc.c index 468e057a84..ecbef4f805 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -12,7 +12,7 @@ ** ** Memory allocation functions used throughout sqlite. ** -** $Id: malloc.c,v 1.56 2009/02/17 18:37:29 drh Exp $ +** $Id: malloc.c,v 1.57 2009/02/19 20:50:15 drh Exp $ */ #include "sqliteInt.h" #include @@ -407,95 +407,6 @@ void sqlite3ScratchFree(void *p){ } } -/* -** Allocate memory to be used by the page cache. Make use of the -** memory buffer provided by SQLITE_CONFIG_PAGECACHE if there is one -** and that memory is of the right size and is not completely -** consumed. Otherwise, failover to sqlite3Malloc(). -*/ -#if 0 -void *sqlite3PageMalloc(int n){ - void *p; - assert( n>0 ); - assert( (n & (n-1))==0 ); - assert( n>=512 && n<=32768 ); - - if( sqlite3GlobalConfig.szPage=(void*)mem0.aPageFree ){ - /* In this case, the page allocation was obtained from a regular - ** call to sqlite3_mem_methods.xMalloc() (a page-cache-memory - ** "overflow"). Free the block with sqlite3_mem_methods.xFree(). - */ - if( sqlite3GlobalConfig.bMemstat ){ - int iSize = sqlite3MallocSize(p); - sqlite3_mutex_enter(mem0.mutex); - sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_OVERFLOW, -iSize); - sqlite3StatusAdd(SQLITE_STATUS_MEMORY_USED, -iSize); - sqlite3GlobalConfig.m.xFree(p); - sqlite3_mutex_leave(mem0.mutex); - }else{ - sqlite3GlobalConfig.m.xFree(p); - } - }else{ - /* The page allocation was allocated from the sqlite3GlobalConfig.pPage - ** buffer. In this case all that is add the index of the page in - ** the sqlite3GlobalConfig.pPage array to the set of free indexes stored - ** in the mem0.aPageFree[] array. - */ - int i; - i = (u8 *)p - (u8 *)sqlite3GlobalConfig.pPage; - i /= sqlite3GlobalConfig.szPage; - assert( i>=0 && i