From: Vladimír Čunát Date: Wed, 13 Mar 2019 12:10:06 +0000 (+0100) Subject: engine: switch to static allocation instead of stack X-Git-Tag: v4.1.0~21^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07edf08295978cacc3fb9c714711c07ed0bedd55;p=thirdparty%2Fknot-resolver.git engine: switch to static allocation instead of stack --- diff --git a/daemon/main.c b/daemon/main.c index 1a93c45d7..764ab4fea 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -757,7 +757,9 @@ int main(int argc, char **argv) .ctx = mp_new (4096), .alloc = (knot_mm_alloc_t) mp_alloc }; - struct engine engine; + /** Static to work around lua_pushlightuserdata() limitations. + * TODO: convert to a proper singleton like worker, most likely. */ + static struct engine engine; ret = engine_init(&engine, &pool); if (ret != 0) { kr_log_error("[system] failed to initialize engine: %s\n", kr_strerror(ret));