+17
-0
lines changedFilter options
+17
-0
lines changed Original file line number Diff line number Diff line change
@@ -408,6 +408,19 @@ main(void)
408
408
if(TS_HAS_SET_MATCH_LIMIT)
409
409
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_MATCH_LIMIT")
410
410
endif()
411
+
check_c_source_compiles("
412
+
#include <stdlib.h>
413
+
#include <tree_sitter/api.h>
414
+
int
415
+
main(void)
416
+
{
417
+
ts_set_allocator(malloc, calloc, realloc, free);
418
+
return 0;
419
+
}
420
+
" TS_HAS_SET_ALLOCATOR)
421
+
if(TS_HAS_SET_ALLOCATOR)
422
+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_ALLOCATOR")
423
+
endif()
411
424
412
425
# Note: The test lib requires LuaJIT; it will be skipped if LuaJIT is missing.
413
426
option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF)
Original file line number Diff line number Diff line change
@@ -129,6 +129,10 @@ void tslua_init(lua_State *L)
129
129
build_meta(L, TS_META_QUERY, query_meta);
130
130
build_meta(L, TS_META_QUERYCURSOR, querycursor_meta);
131
131
build_meta(L, TS_META_TREECURSOR, treecursor_meta);
132
+
133
+
#ifdef NVIM_TS_HAS_SET_ALLOCATOR
134
+
ts_set_allocator(xmalloc, xcalloc, xrealloc, xfree);
135
+
#endif
132
136
}
133
137
134
138
int tslua_has_language(lua_State *L)
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4