Fix a bug in memory usage tracking that was introduced by

check-in [4e33a0eaf83922].

FossilOrigin-Name: 8ba456ae0b3d0c0b6f72f98bd0bc28f72dfa4ff5
This commit is contained in:
drh 2011-05-05 17:00:51 +00:00
parent ef45bb75b3
commit 2e5a422eee
3 changed files with 9 additions and 9 deletions

View File

@ -1,5 +1,5 @@
C Bump\sthe\sversion\snumber\sto\s3.7.7\son\saccount\sof\sthe\snew\ssqlite3_vtab_config()\nand\ssqlite3_vtab_on_conflict()\sinterfaces.\s\sUpdates\sto\sthe\sdocumentation\son\nthose\sinterfaces.
D 2011-05-05T15:39:50.869
C Fix\sa\sbug\sin\smemory\susage\stracking\sthat\swas\sintroduced\sby\ncheck-in\s[4e33a0eaf83922].
D 2011-05-05T17:00:51.731
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 7a4d9524721d40ef9ee26f93f9bd6a51dba106f2
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -145,7 +145,7 @@ F src/legacy.c a199d7683d60cef73089e892409113e69c23a99f
F src/lempar.c 7f026423f4d71d989e719a743f98a1cbd4e6d99e
F src/loadext.c 3ae0d52da013a6326310655be6473fd472347b85
F src/main.c a8571665d43ff18f89a49d47a281605ce5ea825e
F src/malloc.c 74c740e8ba22b806cfb980c8c0ddea1cbd54a20e
F src/malloc.c 591aedb20ae40813f1045f2ef253438a334775d9
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
F src/mem1.c 00bd8265c81abb665c48fea1e0c234eb3b922206
F src/mem2.c e307323e86b5da1853d7111b68fd6b84ad6f09cf
@ -933,7 +933,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P 8485855afc71fb8078d53719c3da75021890ce9e
R d001197d2ada5bdc77fdb1803c900b72
P 930be6a1bdec8c150caafd790973f7a401fc1970
R 74676c63d123716a920c0fc74bf1b85a
U drh
Z b6f82da815334ecd28dc3bea3383de2d
Z e5c86bfd12ceffed2348ff2cb6b52064

View File

@ -1 +1 @@
930be6a1bdec8c150caafd790973f7a401fc1970
8ba456ae0b3d0c0b6f72f98bd0bc28f72dfa4ff5

View File

@ -533,7 +533,7 @@ void *sqlite3Realloc(void *pOld, int nBytes){
nDiff = nNew - nOld;
if( sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED) >=
mem0.alarmThreshold-nDiff ){
sqlite3MallocAlarm(nNew-nOld);
sqlite3MallocAlarm(nDiff);
}
assert( sqlite3MemdebugHasType(pOld, MEMTYPE_HEAP) );
assert( sqlite3MemdebugNoType(pOld, ~MEMTYPE_HEAP) );
@ -544,7 +544,7 @@ void *sqlite3Realloc(void *pOld, int nBytes){
}
if( pNew ){
nNew = sqlite3MallocSize(pNew);
sqlite3StatusAdd(SQLITE_STATUS_MEMORY_USED, nDiff);
sqlite3StatusAdd(SQLITE_STATUS_MEMORY_USED, nNew-nOld);
}
sqlite3_mutex_leave(mem0.mutex);
}else{