aboutsummaryrefslogtreecommitdiff
path: root/src/malloc.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2017-01-13 12:53:35 +0000
committerdrh <drh@noemail.net>2017-01-13 12:53:35 +0000
commitbe7a0cee4eb3be876182a23f004b4de2d8f2103f (patch)
tree7427989e9c7ef9a386bc51dc358f97a11b2d6414 /src/malloc.c
parent7b20a15d1380ed7b2415e3b489695dbcd016c039 (diff)
downloadsqlite-be7a0cee4eb3be876182a23f004b4de2d8f2103f.tar.gz
sqlite-be7a0cee4eb3be876182a23f004b4de2d8f2103f.zip
Fix the build for SQLITE_ENABLE_MEMORY_MANAGEMENT.
FossilOrigin-Name: 8c85b8fdd7f0ba65fba83361d361a567b797a184
Diffstat (limited to 'src/malloc.c')
-rw-r--r--src/malloc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/malloc.c b/src/malloc.c
index 053b57b47..0a3d891e9 100644
--- a/src/malloc.c
+++ b/src/malloc.c
@@ -219,11 +219,12 @@ static void sqlite3MallocAlarm(int nByte){
*/
static void mallocWithAlarm(int n, void **pp){
void *p;
+ int nFull = 0;
assert( sqlite3_mutex_held(mem0.mutex) );
sqlite3StatusHighwater(SQLITE_STATUS_MALLOC_SIZE, n);
if( mem0.alarmThreshold>0 ){
sqlite3_int64 nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED);
- int nFull = sqlite3GlobalConfig.m.xRoundup(n);
+ nFull = sqlite3GlobalConfig.m.xRoundup(n);
if( nUsed >= mem0.alarmThreshold - nFull ){
mem0.nearlyFull = 1;
sqlite3MallocAlarm(nFull);
@@ -239,7 +240,7 @@ static void mallocWithAlarm(int n, void **pp){
}
#endif
if( p ){
- int nFull = sqlite3MallocSize(p);
+ nFull = sqlite3MallocSize(p);
sqlite3StatusUp(SQLITE_STATUS_MEMORY_USED, nFull);
sqlite3StatusUp(SQLITE_STATUS_MALLOC_COUNT, 1);
}