diff src/misc2.c @ 15209:3a99b2e6d136 v8.1.0614

patch 8.1.0614: placing signs can be complicated commit https://github.com/vim/vim/commit/162b71479bd4dcdb3a2ef9198a1444f6f99e6843 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 21 15:17:36 2018 +0100 patch 8.1.0614: placing signs can be complicated Problem: Placing signs can be complicated. Solution: Add functions for defining and placing signs. Introduce a group name to avoid different plugins using the same signs. (Yegappan Lakshmanan, closes #3652)
author Bram Moolenaar <Bram@vim.org>
date Fri, 21 Dec 2018 15:30:07 +0100
parents 2d8c31ae1e24
children de63593896b3
line wrap: on
line diff
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -895,6 +895,19 @@ alloc_clear(unsigned size)
 }
 
 /*
+ * Same as alloc_clear() but with allocation id for testing
+ */
+    char_u *
+alloc_clear_id(unsigned size, alloc_id_T id UNUSED)
+{
+#ifdef FEAT_EVAL
+    if (alloc_fail_id == id && alloc_does_fail((long_u)size))
+	return NULL;
+#endif
+    return alloc_clear(size);
+}
+
+/*
  * alloc() with check for maximum line length
  */
     char_u *