aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval_defs.h
diff options
context:
space:
mode:
authoroni-link <knil.ino@gmail.com>2015-09-04 13:30:02 +0200
committeroni-link <knil.ino@gmail.com>2015-09-07 13:03:15 +0200
commit6ea21f5668e844457c70d2a33326f3a849f1f517 (patch)
treef383469eed629e190513d7408436718ad95e2437 /src/nvim/eval_defs.h
parentbb46cc2c9ce9a36f19df5c29a403c1feb4dbdf88 (diff)
downloadrneovim-6ea21f5668e844457c70d2a33326f3a849f1f517.tar.gz
rneovim-6ea21f5668e844457c70d2a33326f3a849f1f517.tar.bz2
rneovim-6ea21f5668e844457c70d2a33326f3a849f1f517.zip
vim-patch:7.4.609
Problem: For complicated list and dict use the garbage collector can run out of stack space. Solution: Use a stack of dicts and lists to be marked, thus making it iterative instead of recursive. (Ben Fritz) https://github.com/vim/vim/commit/2459a5ecaa43c8549ea53e9364253ff891676da5
Diffstat (limited to 'src/nvim/eval_defs.h')
-rw-r--r--src/nvim/eval_defs.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/nvim/eval_defs.h b/src/nvim/eval_defs.h
index 0faf860588..a8a8acd048 100644
--- a/src/nvim/eval_defs.h
+++ b/src/nvim/eval_defs.h
@@ -120,4 +120,16 @@ struct dictvar_S {
// prevent garbage collection
};
-#endif // NVIM_EVAL_DEFS_H
+// structure used for explicit stack while garbage collecting hash tables
+typedef struct ht_stack_S {
+ hashtab_T *ht;
+ struct ht_stack_S *prev;
+} ht_stack_T;
+
+// structure used for explicit stack while garbage collecting lists
+typedef struct list_stack_S {
+ list_T *list;
+ struct list_stack_S *prev;
+} list_stack_T;
+
+#endif // NVIM_EVAL_DEFS_H