From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: MPS gc_init_header Date: Fri, 09 Aug 2024 11:31:55 +0200 Message-ID: <87a5hmqbxw.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35825"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Aug 09 11:32:52 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1scLzQ-0009E3-A5 for ged-emacs-devel@m.gmane-mx.org; Fri, 09 Aug 2024 11:32:52 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1scLye-0005B1-3n; Fri, 09 Aug 2024 05:32:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1scLyc-00054I-2k for emacs-devel@gnu.org; Fri, 09 Aug 2024 05:32:02 -0400 Original-Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1scLyZ-0000PC-RV for emacs-devel@gnu.org; Fri, 09 Aug 2024 05:32:01 -0400 Original-Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a7abe5aa9d5so241048166b.1 for ; Fri, 09 Aug 2024 02:31:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723195917; x=1723800717; darn=gnu.org; h=mime-version:user-agent:message-id:date:cc:subject:to:from:from:to :cc:subject:date:message-id:reply-to; bh=BnFz3h9Ameax13Rspp6sSv6gPZ64+2aqa2Fuz8Z1rfk=; b=LXZ8lYzlpmwWZdzE+8R4Qd06fVi2Bbed1DvLtB8rGAWeAfEV+G5l3Yqq33T0COkraN 1bqK80RfyZ+VE3F05GMEYXsBNi44G4L6rXk6SANrA7cWYQGIfQ/ztCRl0k/e1vcd0hGa PsVJIRyWJC/IT/gFQMrQdVjS3sxaABnMdgIB/sYVwmUbswiGR/ZmldjvKewnr0xPcmNy KA+bh5ph1RhoDeyEHfhLcpIEjXoyhX4PaUQo8jC8iIcFaK713FQVA3MWDiy3+sf46g6o RlWnoi37w5t9tgx7PGlkKuzZFtaKW09S+LvlC6+sSEKhR5ogeOWDRw9NKOplRX/4QJnM jyvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723195917; x=1723800717; h=mime-version:user-agent:message-id:date:cc:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BnFz3h9Ameax13Rspp6sSv6gPZ64+2aqa2Fuz8Z1rfk=; b=pKCncz4Ww6aqr8+lnrk2LB+PnDxs+Zm+7OG7ZpVstdWtr+RVv7LAPAIdL8MPIq8ESX 2zUKB4+0rjzkiqkjEw0uHHRWGruSg70It1EsVgCD3tDzmBbpd6PDbLm5Fxs3OkHvfNNv 4hrdDAfWRg+l4B72h6ItLM4tiJMmY8DObUNWdhtNpdlHJAnLY4cFdtybMwXQEn2l/e+S AGqCjGCRe3xmhT+uEk1JspFyLlkj05HwzbizXWlu95Tl5fDERVMeah25D6NuSzgw7BQn j6tpsSWgepOCKFiXWBD5OkqrkT4LhqMf07JwufrFvSC1Q5Nu+F1JUqyy7r7BxvRsJRDR F9VA== X-Gm-Message-State: AOJu0YzjWL2eDJJxoUrhwSbGbAhkHeT7w1esYHHpCjLBJntNOJr6sG2J n9EeHBDFcRcMrxBLZUfrNIDHfv+X0AEIhUq+EHKOkU/jOij1GHosNwxaNA== X-Google-Smtp-Source: AGHT+IHvO3+KXF8Fh8JYl7m5g+VmeOiRThGPbSpXi5Zn+M8Pr2VOCeNE26R92JGrWqfmoFvVXvZjkQ== X-Received: by 2002:a17:907:f715:b0:a7d:a29e:5c41 with SMTP id a640c23a62f3a-a80aa5ebb2emr76041066b.40.1723195916681; Fri, 09 Aug 2024 02:31:56 -0700 (PDT) Original-Received: from caladan (dial-181089.pool.broadband44.net. [212.46.181.89]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dd074ec36sm791355266b.57.2024.08.09.02.31.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Aug 2024 02:31:56 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=eller.helmut@gmail.com; helo=mail-ej1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:322557 Archived-At: --=-=-= Content-Type: text/plain Some calls to gc_init_header seem to be redundant: alloc_impl initializes the header, so igc_make_cons etc. don't need to call gc_init_header. Would you mind removing those extra calls? --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Remove-redundant-calls-to-gc_init_header.patch >From b8799978aceb826fd31c4096761745be8040d9e1 Mon Sep 17 00:00:00 2001 From: Helmut Eller Date: Fri, 9 Aug 2024 11:23:42 +0200 Subject: [PATCH] Remove redundant calls to gc_init_header * igc.c (igc_make_cons, igc_alloc_symbol, igc_make_float) (igc_make_string): The header is already initialized, not need to do it again. --- src/igc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/igc.c b/src/igc.c index 52d52ca7a91..f069a2becc9 100644 --- a/src/igc.c +++ b/src/igc.c @@ -3827,7 +3827,6 @@ igc_make_cons (Lisp_Object car, Lisp_Object cdr) struct Lisp_Cons *cons = alloc (sizeof *cons, IGC_OBJ_CONS); cons->u.s.car = car; cons->u.s.u.cdr = cdr; - gc_init_header (&cons->gc_header, IGC_OBJ_CONS); return make_lisp_ptr (cons, Lisp_Cons); } @@ -3835,7 +3834,6 @@ igc_make_cons (Lisp_Object car, Lisp_Object cdr) igc_alloc_symbol (void) { struct Lisp_Symbol *sym = alloc (sizeof *sym, IGC_OBJ_SYMBOL); - gc_init_header (&sym->gc_header, IGC_OBJ_SYMBOL); return make_lisp_symbol (sym); } @@ -3844,7 +3842,6 @@ igc_make_float (double val) { struct Lisp_Float *f = alloc (sizeof *f, IGC_OBJ_FLOAT); f->u.data = val; - gc_init_header (&f->gc_header, IGC_OBJ_FLOAT); return make_lisp_ptr (f, Lisp_Float); } @@ -3916,7 +3913,6 @@ igc_make_string (size_t nchars, size_t nbytes, bool unibyte, bool clear) s->u.s.size = nchars; s->u.s.size_byte = unibyte ? -1 : nbytes; s->u.s.data = alloc_string_data (nbytes, clear); - gc_init_header (&s->gc_header, IGC_OBJ_STRING); return make_lisp_ptr (s, Lisp_String); } -- 2.39.2 --=-=-=--