From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id D9B071F87F for ; Sun, 18 Nov 2018 08:18:47 +0000 (UTC) From: Eric Wong To: spew@80x24.org Subject: [PATCH] mjit_worker.c: avoid redundant list initialization Date: Sun, 18 Nov 2018 08:18:47 +0000 Message-Id: <20181118081847.16293-1-e@80x24.org> List-Id: mjit_init already initializes the list, and we will need to initialize it after forking, too. --- mjit.c | 1 - mjit_worker.c | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/mjit.c b/mjit.c index 047971f162..877b764f0a 100644 --- a/mjit.c +++ b/mjit.c @@ -122,7 +122,6 @@ mjit_free_iseq(const rb_iseq_t *iseq) CRITICAL_SECTION_FINISH(4, "mjit_free_iseq"); } -/* Do we need this...? */ static void init_list(struct rb_mjit_unit_list *list) { diff --git a/mjit_worker.c b/mjit_worker.c index 19409ee00e..f44ebf0981 100644 --- a/mjit_worker.c +++ b/mjit_worker.c @@ -173,13 +173,12 @@ int mjit_enabled = FALSE; and `mjit_call_p == FALSE`, any JIT-ed code execution is cancelled as soon as possible. */ int mjit_call_p = FALSE; -/* Priority queue of iseqs waiting for JIT compilation. - This variable is a pointer to head unit of the queue. */ -static struct rb_mjit_unit_list unit_queue = { LIST_HEAD_INIT(unit_queue.head) }; +/* Priority queue of iseqs waiting for JIT compilation */ +static struct rb_mjit_unit_list unit_queue; /* List of units which are successfully compiled. */ -static struct rb_mjit_unit_list active_units = { LIST_HEAD_INIT(active_units.head) }; +static struct rb_mjit_unit_list active_units; /* List of compacted so files which will be cleaned up by `free_list()` in `mjit_finish()`. */ -static struct rb_mjit_unit_list compact_units = { LIST_HEAD_INIT(compact_units.head) }; +static struct rb_mjit_unit_list compact_units; /* The number of so far processed ISEQs, used to generate unique id. */ static int current_unit_num; /* A mutex for conitionals and critical sections. */ -- EW