aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/malloc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/malloc.c b/src/malloc.c
index ef7d2e1ed..9a635e716 100644
--- a/src/malloc.c
+++ b/src/malloc.c
@@ -228,9 +228,9 @@ static void sqlite3MallocAlarm(int nByte){
** code debuggers when working on out-of-memory conditions, for example
** caused by PRAGMA hard_heap_limit=N.
*/
-static SQLITE_NOINLINE void test_oom_breakpoint(void){
+static SQLITE_NOINLINE void test_oom_breakpoint(u64 n){
static u64 nOomFault = 0;
- nOomFault++;
+ nOomFault += n;
/* The assert() is never reached in a human lifetime. It is here mostly
** to prevent code optimizers from optimizing out this function. */
assert( (nOomFault>>32) < 0xffffffff );
@@ -265,7 +265,7 @@ static void mallocWithAlarm(int n, void **pp){
if( mem0.hardLimit ){
nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED);
if( nUsed >= mem0.hardLimit - nFull ){
- test_oom_breakpoint();
+ test_oom_breakpoint(1);
*pp = 0;
return;
}
@@ -554,7 +554,7 @@ void *sqlite3Realloc(void *pOld, u64 nBytes){
sqlite3MallocAlarm(nDiff);
if( mem0.hardLimit>0 && nUsed >= mem0.hardLimit - nDiff ){
sqlite3_mutex_leave(mem0.mutex);
- test_oom_breakpoint();
+ test_oom_breakpoint(1);
return 0;
}
}