From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: MPS: staticpro everything Date: Wed, 01 May 2024 16:12:15 +0300 Message-ID: <86sez1oevk.fsf@gnu.org> References: <87bk5tc1j6.fsf@gmail.com> <877cghc0yy.fsf@gmail.com> <86jzkhu5rv.fsf@gnu.org> <87ttjlabic.fsf@gmail.com> <87v8408wsr.fsf@gmail.com> <87o79sasl5.fsf@gmail.com> <87plu72y8h.fsf@gmail.com> <877cgfwe5g.fsf_-_@gmail.com> <871q6mptkj.fsf@gmail.com> <87o79qng1p.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38037"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eller.helmut@gmail.com, emacs-devel@gnu.org To: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 01 15:13:24 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 1s29ly-0009cX-83 for ged-emacs-devel@m.gmane-mx.org; Wed, 01 May 2024 15:13:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s29l0-00076d-8o; Wed, 01 May 2024 09:12:22 -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 1s29kx-00076V-Ik for emacs-devel@gnu.org; Wed, 01 May 2024 09:12:19 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s29kx-0007Nm-8s; Wed, 01 May 2024 09:12:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=+72Q6N/bmtmfjuYOB6Scr1X5cJ4uXhfNxN14xWs34QI=; b=EpaBfe7Zgs+SwJcynQdi 3BoI944vovpcS5Ab1mCTibhzNjeUlNF0SNYxkCqgce7KyumHo9aMKeIbjIEHEJ6koSmPi9smd+2Gb r/yF+H8Hphb9FPWzJt5cm/Df1jSKDydBfogmdSZo5SPK7YbactBm6DUr7YyUBd+isI337/qWRZ8X+ 6wn8kLBTIo17Hpm+JG0Op3kn/K1O1e3TSmJDD/tHW5w/D/fEZezCufmv/Vv4AkMlR2QW9LuzIleZJ HtEWFHDfPdbm6jSQAPQIwMahfN+8EtIBqnguhjEPjZzi3DUAZ60xp1lqLspEJfckgnseJjd9NZvtV /+6fgefnC3np+w==; In-Reply-To: (message from Gerd =?utf-8?Q?M=C3=B6llmann?= on Wed, 01 May 2024 09:46:25 +0200) 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:318471 Archived-At: > From: Gerd Möllmann > Cc: Eli Zaretskii , emacs-devel@gnu.org > Date: Wed, 01 May 2024 09:46:25 +0200 > > Helmut Eller writes: > > >> I'm not sure what is with the buffer case, but the string case means > >> that source can point to string data, which is in our MPS leaf_pool. I > >> think we cvould use an exact scan function for that purpose, analogous > >> to scan_specpdl. WSYT? > > > > Yes, I think would work. > > With an additional complication: the string is in MPS, of course, and to > get to its u.s.data pointer we would need to access it, say to compute a > new source pointer in case the string has moved. I'm not sure such an > access is allowed in a root scan function, because of barriers :-/. Can a string move while coding.c uses a pointer to it? With the old GC, it couldn't, or else we couldn't be using the pointer to its data. coding_set_source is basically a small utility function, almost a macro, that is called at the beginning of en/decoding processing, and the stuff it sets up is used during that processing; it never leaks outside of the caller of coding_set_source. So I wonder whether we indeed need to do something about this (and similarly about the buffer text branch there), or maybe we see a problem where there is none? I already asked more serious question related to this, so I won't repeat them here. > Maybe one could replace char *source with an index? Or passing the src > around instead of the char*? I don't know how it is used, though. That way lies madness: we will have to basically abandon any C-level access via pointers to members of struct's that back Lisp objects. E.g., we have gobs of functions that access windows via pointers to 'struct window'. > > But I just realized that now that about any char* needs to be looked > > upon very carefully to decide if it could point to the leaf_pool. > > That's a problem. Maybe a show-stopper kind-of problem. > > Could be. I wonder how to find out how many of these cases there are. They are all over the place, IIUC. Scary.