aboutsummaryrefslogtreecommitdiff
path: root/src/mem2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem2.c')
-rw-r--r--src/mem2.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mem2.c b/src/mem2.c
index 57a610225..d9653ee81 100644
--- a/src/mem2.c
+++ b/src/mem2.c
@@ -12,7 +12,7 @@
** This file contains the C functions that implement a memory
** allocation subsystem for use by SQLite.
**
-** $Id: mem2.c,v 1.6 2007/08/22 20:18:22 drh Exp $
+** $Id: mem2.c,v 1.7 2007/08/22 22:04:37 drh Exp $
*/
/*
@@ -455,6 +455,15 @@ int sqlite3_memdebug_fail(int iFail, int iRepeat){
}
/*
+** This routine returns the number of successful mallocs remaining until
+** the next simulated malloc failure. -1 is returned if no simulated
+** failure is currently scheduled.
+*/
+int sqlite3_memdebug_pending(void){
+ return mem.iFail-1;
+}
+
+/*
** The following two routines are used to assert that no memory
** allocations occur between one call and the next. The use of
** these routines does not change the computed results in any way.