comparison 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
comparison
equal deleted inserted replaced
27896:960de0084729 27897:2a2c0958a913
1606 #endif 1606 #endif
1607 1607
1608 // Allocate memory for one type and cast the returned pointer to have the 1608 // Allocate memory for one type and cast the returned pointer to have the
1609 // compiler check the types. 1609 // compiler check the types.
1610 #define ALLOC_ONE(type) (type *)alloc(sizeof(type)) 1610 #define ALLOC_ONE(type) (type *)alloc(sizeof(type))
1611 #define ALLOC_ONE_ID(type, id) (type *)alloc_id(sizeof(type), id)
1611 #define ALLOC_MULT(type, count) (type *)alloc(sizeof(type) * (count)) 1612 #define ALLOC_MULT(type, count) (type *)alloc(sizeof(type) * (count))
1612 #define ALLOC_CLEAR_ONE(type) (type *)alloc_clear(sizeof(type)) 1613 #define ALLOC_CLEAR_ONE(type) (type *)alloc_clear(sizeof(type))
1614 #define ALLOC_CLEAR_ONE_ID(type, id) (type *)alloc_clear_id(sizeof(type), id)
1613 #define ALLOC_CLEAR_MULT(type, count) (type *)alloc_clear(sizeof(type) * (count)) 1615 #define ALLOC_CLEAR_MULT(type, count) (type *)alloc_clear(sizeof(type) * (count))
1614 #define LALLOC_CLEAR_ONE(type) (type *)lalloc_clear(sizeof(type), FALSE) 1616 #define LALLOC_CLEAR_ONE(type) (type *)lalloc_clear(sizeof(type), FALSE)
1615 #define LALLOC_CLEAR_MULT(type, count) (type *)lalloc_clear(sizeof(type) * (count), FALSE) 1617 #define LALLOC_CLEAR_MULT(type, count) (type *)lalloc_clear(sizeof(type) * (count), FALSE)
1616 #define LALLOC_MULT(type, count) (type *)lalloc(sizeof(type) * (count), FALSE) 1618 #define LALLOC_MULT(type, count) (type *)lalloc(sizeof(type) * (count), FALSE)
1617 1619