Mercurial > vim
diff src/vim.h @ 27897:2a2c0958a913 v8.2.4474
patch 8.2.4474: memory allocation failures not tested in quickfix code
Commit: https://github.com/vim/vim/commit/5a2d4a3ecb67942d47615507a163ffcd5863c073
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Sat Feb 26 10:31:32 2022 +0000
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 https://github.com/vim/vim/issues/9848)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 26 Feb 2022 11:45:03 +0100 |
parents | 30cb026ec968 |
children | b737bfa876c5 |
line wrap: on
line diff
--- a/src/vim.h +++ b/src/vim.h @@ -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)