aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lib
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2016-01-01 14:37:20 +0300
committerBjörn Linse <bjorn.linse@gmail.com>2016-08-31 21:40:20 +0200
commit5e59916e84933b0b05fda8ed76cf5f24fa3f48b6 (patch)
treee82e7c531c79a2d71ec9889b3206cafe1d3121c8 /src/nvim/lib
parentabe00d583e06a67b9eddbe0aed255a8db06bc725 (diff)
downloadrneovim-5e59916e84933b0b05fda8ed76cf5f24fa3f48b6.tar.gz
rneovim-5e59916e84933b0b05fda8ed76cf5f24fa3f48b6.tar.bz2
rneovim-5e59916e84933b0b05fda8ed76cf5f24fa3f48b6.zip
eval: Use generated hash to look up function list
Problems: - Disables cross-compiling (alternative: keeps two hash implementations which need to be synchronized with each other). - Puts code-specific name literals into CMakeLists.txt. - Workaround for lua’s absence of bidirectional pipe communication is rather ugly.
Diffstat (limited to 'src/nvim/lib')
-rw-r--r--src/nvim/lib/khash.h41
1 files changed, 29 insertions, 12 deletions
diff --git a/src/nvim/lib/khash.h b/src/nvim/lib/khash.h
index 8287cb14da..f8530be79a 100644
--- a/src/nvim/lib/khash.h
+++ b/src/nvim/lib/khash.h
@@ -130,7 +130,9 @@ int main() {
#include <limits.h>
#include <stdint.h>
-#include "nvim/memory.h"
+#ifndef USE_LIBC_ALLOCATOR
+# include "nvim/memory.h"
+#endif
#include "nvim/func_attr.h"
@@ -171,17 +173,32 @@ typedef khint_t khiter_t;
#define kroundup32(x) (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x))
#endif
-#ifndef kcalloc
-#define kcalloc(N,Z) xcalloc(N,Z)
-#endif
-#ifndef kmalloc
-#define kmalloc(Z) xmalloc(Z)
-#endif
-#ifndef krealloc
-#define krealloc(P,Z) xrealloc(P,Z)
-#endif
-#ifndef kfree
-#define kfree(P) xfree(P)
+#ifdef USE_LIBC_ALLOCATOR
+# ifndef kcalloc
+# define kcalloc(N,Z) calloc(N,Z)
+# endif
+# ifndef kmalloc
+# define kmalloc(Z) malloc(Z)
+# endif
+# ifndef krealloc
+# define krealloc(P,Z) realloc(P,Z)
+# endif
+# ifndef kfree
+# define kfree(P) free(P)
+# endif
+#else
+# ifndef kcalloc
+# define kcalloc(N,Z) xcalloc(N,Z)
+# endif
+# ifndef kmalloc
+# define kmalloc(Z) xmalloc(Z)
+# endif
+# ifndef krealloc
+# define krealloc(P,Z) xrealloc(P,Z)
+# endif
+# ifndef kfree
+# define kfree(P) xfree(P)
+# endif
#endif
#define __ac_HASH_UPPER 0.77