mirror of
https://github.com/neovim/neovim.git
synced 2025-09-12 06:18:16 +00:00
No OOM error conditions in some functions of window.c
- alloc_tabpage() - win_alloc_lines() - win_alloc_aucmd_win() - new_frame() - win_alloc() TODO: don't handle OOM after calls to dict_alloc()
This commit is contained in:

committed by
Thiago de Arruda

parent
6d193b0b37
commit
28b03dd190
28
src/eval.c
28
src/eval.c
@@ -6105,23 +6105,21 @@ void set_ref_in_item(typval_T *tv, int copyID)
|
||||
*/
|
||||
dict_T *dict_alloc(void)
|
||||
{
|
||||
dict_T *d;
|
||||
dict_T *d = xmalloc(sizeof(dict_T));
|
||||
|
||||
d = (dict_T *)alloc(sizeof(dict_T));
|
||||
if (d != NULL) {
|
||||
/* Add the dict to the list of dicts for garbage collection. */
|
||||
if (first_dict != NULL)
|
||||
first_dict->dv_used_prev = d;
|
||||
d->dv_used_next = first_dict;
|
||||
d->dv_used_prev = NULL;
|
||||
first_dict = d;
|
||||
/* Add the dict to the list of dicts for garbage collection. */
|
||||
if (first_dict != NULL)
|
||||
first_dict->dv_used_prev = d;
|
||||
d->dv_used_next = first_dict;
|
||||
d->dv_used_prev = NULL;
|
||||
first_dict = d;
|
||||
|
||||
hash_init(&d->dv_hashtab);
|
||||
d->dv_lock = 0;
|
||||
d->dv_scope = 0;
|
||||
d->dv_refcount = 0;
|
||||
d->dv_copyID = 0;
|
||||
|
||||
hash_init(&d->dv_hashtab);
|
||||
d->dv_lock = 0;
|
||||
d->dv_scope = 0;
|
||||
d->dv_refcount = 0;
|
||||
d->dv_copyID = 0;
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user