From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: MPS: Forwording symbols Date: Fri, 21 Jun 2024 17:41:18 +0200 Message-ID: References: <878qyy1f55.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="326"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Emacs Devel , Eli Zaretskii To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 21 17:42:05 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 1sKgOp-000AVA-3s for ged-emacs-devel@m.gmane-mx.org; Fri, 21 Jun 2024 17:42:03 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKgOD-0000u0-Hc; Fri, 21 Jun 2024 11:41:25 -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 1sKgOB-0000tB-VT for emacs-devel@gnu.org; Fri, 21 Jun 2024 11:41:24 -0400 Original-Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sKgOA-00046k-5C; Fri, 21 Jun 2024 11:41:23 -0400 Original-Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-57d07f07a27so2414594a12.3; Fri, 21 Jun 2024 08:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718984480; x=1719589280; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tM28exiQLgxqnGnYXU3BwUy6vSHiMGMK6BhzYLytPKs=; b=ftfKUlMx/hndhpLiJ27e/nnjkfz7oflBSRFZOwMVuh5mmoosfFg+FJGZQ5jwFmjuQC xXKvUuj8nfi5oFNW5joay799JP61xpeCffyv0VSH2ysWwFaX7Rl910KLlT+HXl1ma7Dg MuU3WbQNfWZoLL0ev/Dz84YxOaGj04/KYrMT+jAw29fWV8etfDGzNo0Qk5Mu03nR3GnS MDRjnvAjNg/m+bL2Ce6kDYzHq/PEfh5bHNeyD105qEG3zDeMio/ep22+IVCAQPbrywka IqwnxJ/Cb8Cp7z5T1Im5akquLEsdIViVKsRs04gs5R0TIQwIbSi04V522dIX3aHLa7gn 1nRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718984480; x=1719589280; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=tM28exiQLgxqnGnYXU3BwUy6vSHiMGMK6BhzYLytPKs=; b=KkhEn2BCTTs6Vp3re1bnEdFK+sGnF7JmHpR2yZj0ytWk20HKr4XLizSiWUAaCZNcpp kuvEgaW6kPN4grRmY20Vi3Si9OwWGOJJ+Ww521++AAClZOTTPvzznrfLuKVs0RsOi5qb XapgsZ/1tg+oktOFnGwkP1LZ8KykVu7Z1Xk0OiC7K80meginq3kqTE8QhAyhO1B024PL XZmEMKQmF58hm+8WscBt3/CVLH8fnQ7ewL7n8oZghpTfI8B3iPjZgHQmf3HltmCMX6Gi 3fEh7TrkyQ0tfqOkZLfwW+G566/BYIjWUvrdWVy7BWj+hU/q8FvckEKWi+uT0K+giNzh Y0kA== X-Forwarded-Encrypted: i=1; AJvYcCVgA4nqUUPoaoN4ZGTZMuPc6YmxVWYfI4QnuoYOmF4ESHXdlKOS3/hf+VoCe9S9pT8hJr0+t7FG2i3hE1o= X-Gm-Message-State: AOJu0Yx6rGwtSwuVrx7yTpeUJyyMuHRa6VuY5RC7CBRDLN8+6927vOOg c5rBgkisSSFn7VXuMkc+s1kNzK04uoMDhga/O/L4+8KM/ocLAgXy98GGpg== X-Google-Smtp-Source: AGHT+IFt/W3JlRsyZLMiq56bKF59tHCwGblwb27Q2PMtM89rPjCcNWR8QTupD4jCaI027W7MY9bMhg== X-Received: by 2002:a50:8711:0:b0:57c:da58:51e7 with SMTP id 4fb4d7f45d1cf-57d07e18fa9mr5779701a12.1.1718984479797; Fri, 21 Jun 2024 08:41:19 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3a72a.dip0.t-ipconnect.de. [79.227.167.42]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57d303d7b10sm1087940a12.15.2024.06.21.08.41.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 08:41:19 -0700 (PDT) In-Reply-To: <878qyy1f55.fsf@gmail.com> (Helmut Eller's message of "Fri, 21 Jun 2024 17:36:54 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x536.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:320415 Archived-At: Helmut Eller writes: > On Sun, Jun 16 2024, Gerd M=C3=B6llmann wrote: > >> Ok, I've looked a bit closer, and I think we can avoid dumping the >> the forwarding structs altogether. >> >> There are 5 types of forwarding structs >> >> enum Lisp_Fwd_Type >> { >> Lisp_Fwd_Int, /* Fwd to a C `int' variable. */ >> Lisp_Fwd_Bool, /* Fwd to a C boolean var. */ >> Lisp_Fwd_Obj, /* Fwd to a C Lisp_Object variable. */ >> Lisp_Fwd_Buffer_Obj, /* Fwd to a Lisp_Object field of buffers. */ >> Lisp_Fwd_Kboard_Obj /* Fwd to a Lisp_Object field of kboards. */ >> }; >> >> Four of them contain only the type and either integer offsets or >> pointers to variables in Emacs' data segment. The only interesting one >> is Lisp_Fwd_Buffer_Obj which looks like >> >> struct Lisp_Buffer_Objfwd >> { >> enum Lisp_Fwd_Type type; /* =3D Lisp_Fwd_Buffer_Obj */ >> int offset; >> /* One of Qnil, Qintegerp, Qsymbolp, Qstringp, Qfloatp or Qnumberp= . */ >> Lisp_Object predicate; >> }; >> >> which has an additional member for the predicate. AFAICT, the comment is >> true, and thus predicate is also a constant because it is always from a >> DEFSYM, i.e. it is a symbol from lispsym. > > Can we use similar reasoning to remove fix_fwd? If predicate is > guaranteed to be a builtin symbol, then we don't need to do anything for > the Lisp_Buffer_Objfwd case. > > Then only remains issue with DEFVAR_LISP_NOPRO. We could simply make > DEFVAR_LISP_NOPRO an alias for the regular DEFVAR_LISP. > > If fix_symbol needs to call fix_fwd, then so should fix_blv. But nicer > would be to remove fix_fwd altogether. Sounds like a good plan to me. Maybe we could also make predicate an enum at the same time? It need not be a Lisp_Object, and replacing it with an enum would make that clearer.