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: Re: MPS: Forwording symbols Date: Fri, 21 Jun 2024 17:36:54 +0200 Message-ID: <878qyy1f55.fsf@gmail.com> References: 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="10640"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Emacs Devel , Eli Zaretskii To: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 21 17:37:18 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 1sKgKD-0002e8-Rj for ged-emacs-devel@m.gmane-mx.org; Fri, 21 Jun 2024 17:37:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKgJy-0007tL-5j; Fri, 21 Jun 2024 11:37:02 -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 1sKgJv-0007qO-CJ for emacs-devel@gnu.org; Fri, 21 Jun 2024 11:36:59 -0400 Original-Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sKgJt-000320-Hd; Fri, 21 Jun 2024 11:36:58 -0400 Original-Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a6ef793f4b8so225260766b.1; Fri, 21 Jun 2024 08:36:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718984215; x=1719589015; 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=bMEXTo2XGNQ8nLUxhfXI3AEasYQINaf8kVhn2uxiMtw=; b=VqruYAOVoUu1uPOF/k/cImNKOacR8tNeYlwUH87G0MdfMa/PcCJUJ3iVeh+2uB5wee lbV80wum72kfwU4y45RR6/IwefwElWBWmVr9wqnj1WlEO6hSHFEwwZ1Sa5+/Dl18wt3R njlbf020KEHISOtgEOQn8kbnF/5hA1ZQbnmmY4ujBFOR4kJ0BTCTe2pa3tJrqHdjMoYu wFfvVL1bUWlnCIj8iptjl+Ph+uq0m5gD3Z0DhD2YTuAfruqc7eRQvx+HGaU3wG/euSn7 pvp1NIbddu64thUOYlsbeACSO7nfm2dWYcd0dJS4eYm/Qd+Zx0h9faPLh+uxcaIvzVml 7grw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718984215; x=1719589015; 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=bMEXTo2XGNQ8nLUxhfXI3AEasYQINaf8kVhn2uxiMtw=; b=KULIwIDVx2AELNui3nj1k7S8DMmnNRRkxMDZHYeVzdMsD2TEpS21XzsKYDkPXrYzGU MzDad20SyV4NOHuVf3PSSTvV8BRzF25G+oc6U3pPdxfp35YwREKBSrdBxpa3VfulOzC1 A6DHnRog1RH2mnMveuyE+JIcweOun4z5yUeVySjRkj0vs6hIcqzBSZ3nB/q94uyD4REZ VCFTTEBTM5KWC+RjjRAKXnKbRY7Z3GZL0Guj0Wxs7I2ifOZGCTbvgy2N9bNsUWIEUvL0 OkkIDGRY7Yf1+Hh3oTBEHNC0xKJLpxsa1E8DwA1Mbf5j07yNan5Z/Xpw0dRP91SQ0XAB YnVQ== X-Forwarded-Encrypted: i=1; AJvYcCV1pNrzaT52Rv6G3NYpFjXVGk/c6pqNb4/60C4Kh1zMTS+uyrlXjoZ7w65nKVXnPifKTh+gZs8Zpjk/oEs= X-Gm-Message-State: AOJu0Yzczt07D0RFwcjR4FynkTTU74fb5sjryD573mEXo22+Cwrkglwg RPNlMB2CxgLucVKVpp067qcJw7Z8gQlYGkzLfhuRxtaO245nCyI/VAr0VQ== X-Google-Smtp-Source: AGHT+IFGZxb6/Jc9OgvRMupx5QYTwR2yHjCvpBa1tU6eolo75v502wJgKv4bpEmLFPWY8/h1cfIScw== X-Received: by 2002:a17:907:c088:b0:a6f:fbc:b3f3 with SMTP id a640c23a62f3a-a6fab779addmr504292866b.47.1718984215380; Fri, 21 Jun 2024 08:36:55 -0700 (PDT) Original-Received: from caladan ([31.177.116.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fcf4bb22dsm95903566b.94.2024.06.21.08.36.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 08:36:55 -0700 (PDT) In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llman?= =?utf-8?Q?n=22's?= message of "Sun, 16 Jun 2024 11:43:11 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=eller.helmut@gmail.com; helo=mail-ej1-x632.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:320414 Archived-At: 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.