0
0
mirror of https://github.com/vim/vim.git synced 2025-10-17 07:44:28 -04:00

patch 8.2.4474: memory allocation failures not tested in quickfix code

Problem:    Memory allocation failures not tested in quickfix code.
Solution:   Add alloc IDs and tests. (Yegappan Lakshmanan, closes #9848)
This commit is contained in:
Yegappan Lakshmanan
2022-02-26 10:31:32 +00:00
committed by Bram Moolenaar
parent 416b5f4894
commit 5a2d4a3ecb
5 changed files with 184 additions and 40 deletions

View File

@@ -1608,8 +1608,10 @@ typedef UINT32_TYPEDEF UINT32_T;
// Allocate memory for one type and cast the returned pointer to have the
// compiler check the types.
#define ALLOC_ONE(type) (type *)alloc(sizeof(type))
#define ALLOC_ONE_ID(type, id) (type *)alloc_id(sizeof(type), id)
#define ALLOC_MULT(type, count) (type *)alloc(sizeof(type) * (count))
#define ALLOC_CLEAR_ONE(type) (type *)alloc_clear(sizeof(type))
#define ALLOC_CLEAR_ONE_ID(type, id) (type *)alloc_clear_id(sizeof(type), id)
#define ALLOC_CLEAR_MULT(type, count) (type *)alloc_clear(sizeof(type) * (count))
#define LALLOC_CLEAR_ONE(type) (type *)lalloc_clear(sizeof(type), FALSE)
#define LALLOC_CLEAR_MULT(type, count) (type *)lalloc_clear(sizeof(type) * (count), FALSE)