aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/typval.h
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2018-01-03 00:00:16 +0300
committerZyX <kp-pav@yandex.ru>2018-01-14 01:33:16 +0300
commit9ea1752d60589e8fc5e7184144bc6d1c1b9f16a3 (patch)
tree8d7fd11beeb2a300bd21f997e3fdca5b4f29382e /src/nvim/eval/typval.h
parent9ddeb6e187e6ef6045bf037e4225dc46c8efb693 (diff)
downloadrneovim-9ea1752d60589e8fc5e7184144bc6d1c1b9f16a3.tar.gz
rneovim-9ea1752d60589e8fc5e7184144bc6d1c1b9f16a3.tar.bz2
rneovim-9ea1752d60589e8fc5e7184144bc6d1c1b9f16a3.zip
*: Provide list length when allocating lists
Diffstat (limited to 'src/nvim/eval/typval.h')
-rw-r--r--src/nvim/eval/typval.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h
index c9a9a3e7e8..3993a384d2 100644
--- a/src/nvim/eval/typval.h
+++ b/src/nvim/eval/typval.h
@@ -31,6 +31,25 @@ typedef double float_T;
/// Refcount for dict or list that should not be freed
enum { DO_NOT_FREE_CNT = (INT_MAX / 2) };
+/// Additional values for tv_list_alloc() len argument
+enum {
+ /// List length is not known in advance
+ ///
+ /// To be used when there is neither a way to know how many elements will be
+ /// needed nor are any educated guesses.
+ kListLenUnknown = -1,
+ /// List length *should* be known, but is actually not
+ ///
+ /// All occurrences of this value should be eventually removed. This is for
+ /// the case when the only reason why list length is not known is that it
+ /// would be hard to code without refactoring, but refactoring is needed.
+ kListLenShouldKnow = -2,
+ /// List length may be known in advance, but it requires too much effort
+ ///
+ /// To be used when it looks impractical to determine list length.
+ kListLenMayKnow = -3,
+} ListLenSpecials;
+
/// Maximal possible value of varnumber_T variable
#define VARNUMBER_MAX INT64_MAX
#define UVARNUMBER_MAX UINT64_MAX