all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Helmut Eller <eller.helmut@gmail.com>
To: Pip Cet <pipcet@protonmail.com>
Cc: emacs-devel@gnu.org
Subject: MPS gc_init_header
Date: Fri, 09 Aug 2024 11:31:55 +0200	[thread overview]
Message-ID: <87a5hmqbxw.fsf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 188 bytes --]

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?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Remove-redundant-calls-to-gc_init_header.patch --]
[-- Type: text/x-diff, Size: 1608 bytes --]

From b8799978aceb826fd31c4096761745be8040d9e1 Mon Sep 17 00:00:00 2001
From: Helmut Eller <eller.helmut@gmail.com>
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


             reply	other threads:[~2024-08-09  9:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-09  9:31 Helmut Eller [this message]
2024-08-09 11:39 ` MPS gc_init_header Pip Cet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a5hmqbxw.fsf@gmail.com \
    --to=eller.helmut@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=pipcet@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.