]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
engine: switch to static allocation instead of stack
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 13 Mar 2019 12:10:06 +0000 (13:10 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 13 Jun 2019 13:02:44 +0000 (15:02 +0200)
daemon/main.c

index 1a93c45d7380692c72c06be6b1254fa35b088ff8..764ab4feab3581b1f7f65ab45951ee79b8faf676 100644 (file)
@@ -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));