1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Fix the build for SQLITE_ENABLE_MEMORY_MANAGEMENT.

FossilOrigin-Name: 8c85b8fdd7f0ba65fba83361d361a567b797a184
This commit is contained in:
drh
2017-01-13 12:53:35 +00:00
parent 7b20a15d13
commit be7a0cee4e
3 changed files with 10 additions and 9 deletions

View File

@@ -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);
}