diff options
Diffstat (limited to 'src/alloc.c')
-rw-r--r-- | src/alloc.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c index 9547d67192..5218d00465 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -719,6 +719,20 @@ ga_grow(garray_T *gap, int n) return OK; } +/* + * Same as ga_grow() but uses an allocation id for testing. + */ + int +ga_grow_id(garray_T *gap, int n, alloc_id_T id UNUSED) +{ +#ifdef FEAT_EVAL + if (alloc_fail_id == id && alloc_does_fail(sizeof(list_T))) + return FAIL; +#endif + + return ga_grow(gap, n); +} + int ga_grow_inner(garray_T *gap, int n) { |