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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user