1
0
forked from aniani/vim

patch 7.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.
This commit is contained in:
Bram Moolenaar
2016-01-07 21:25:08 +01:00
parent 2b7db933b0
commit 75bdf6aa30
8 changed files with 138 additions and 5 deletions

View File

@@ -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.
*/