summaryrefslogtreecommitdiffstats
path: root/src/globals.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-07 21:25:08 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-07 21:25:08 +0100
commit75bdf6aa30a5c99d67c42886cf7a4a000bbaa422 (patch)
treee3e1a3fea418f892524eeec3cb0c2eaa31f5ad61 /src/globals.h
parent2b7db933b0418f3964da5399047ce8998007874c (diff)
patch 7.4.1058v7.4.1058
Problem: It is not possible to test code that is only reached when memory allocation fails. Solution: Add the alloc_fail() function. Try it out with :vimgrep.
Diffstat (limited to 'src/globals.h')
-rw-r--r--src/globals.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/globals.h b/src/globals.h
index d921a4e246..54a1d7256b 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1619,6 +1619,15 @@ EXTERN FILE *time_fd INIT(= NULL); /* where to write startup timing */
EXTERN int ignored;
EXTERN char *ignoredp;
+#ifdef FEAT_EVAL
+/* set by alloc_fail(): ID */
+EXTERN int alloc_fail_id INIT(= 0);
+/* set by alloc_fail(), when zero alloc() returns NULL */
+EXTERN int alloc_fail_countdown INIT(= -1);
+/* set by alloc_fail(), number of times alloc() returns NULL */
+EXTERN int alloc_fail_repeat INIT(= 0);
+#endif
+
/*
* Optional Farsi support. Include it here, so EXTERN and INIT are defined.
*/