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: face-cache Date: Sun, 28 Apr 2024 10:56:30 +0300 Message-ID: <86wmohudht.fsf@gnu.org> References: <87r0eqaslt.fsf@gmail.com> <87mspeas8s.fsf@gmail.com> <8634r6uer3.fsf@gnu.org> 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="7577"; 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 Sun Apr 28 09:56:58 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 1s0zP7-0001jB-Aw for ged-emacs-devel@m.gmane-mx.org; Sun, 28 Apr 2024 09:56:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s0zOl-0004Dz-C6; Sun, 28 Apr 2024 03:56:35 -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 1s0zOk-0004Dn-CZ for emacs-devel@gnu.org; Sun, 28 Apr 2024 03:56:34 -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 1s0zOj-000767-3O; Sun, 28 Apr 2024 03:56:33 -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=wyUJ3jQTFibkqO2GySHwm84byWR4xZUyIs8KM8e91bQ=; b=PBWyP+K8bS7e99sbHehH JQjJZBKQ/NipVkVbg+o5J3VpBEMvCBmDffFPRueV4tHGBJ8KDWpwEiablf/7uboUjE5NIRNlJGyOd FAMFbeI/danSP4D4BZ2VayylB7XzWnLM/fbUbBTmiqFvyWsUuwAgMJ88V5/wb6oG/cB6neHswwh8F 2bCebEXKVklClX7VbNg2QaRidt9dl3HpFFkJ1Eqp2LlfVs7MJWI4tlH7tf8gJmhoHVHEgEgYj97EI GIr3kt0H5BnGHV9xMGYoQLTz7budgwKR6J31RJxN2j+AUF5KuzdGQbE0ckiwkAO0rGWiWpaJviwH2 G6ODgy6mAtZaVw==; In-Reply-To: (message from Gerd =?utf-8?Q?M=C3=B6llmann?= on Sun, 28 Apr 2024 09:38:49 +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:318249 Archived-At: > From: Gerd Möllmann > Cc: eller.helmut@gmail.com, emacs-devel@gnu.org > Date: Sun, 28 Apr 2024 09:38:49 +0200 > > Eli Zaretskii writes: > > >> Someone knows something about this in struct frame? > >> > >> /* List of font-drivers available on the frame. */ > >> struct font_driver_list *font_driver_list; > > > > It's a list of C structs, AFAICT. > > Yes, looks like an interface, like the redisplay one. > > struct font_driver > { > /* Symbol indicating the type of the font-driver. */ > Lisp_Object type; > > /* True iff the font's foundry, family, and adstyle names are case > sensitive. */ > bool case_sensitive; > > /* Return a cache of font-entities on frame F. The cache must be a > cons whose cdr part is the actual cache area. */ > Lisp_Object (*get_cache) (struct frame *f); > ... > > So, somewhere is a cache, that's interesting. Where is it? It's in dpyinfo: Lisp_Object xfont_get_cache (struct frame *f) { Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f); return (dpyinfo->name_list_element); } That name_list_element is the cache, of this form: (DRIVER-TYPE NUM-FRAMES FONT-CACHE-DATA ...) On w32, dpyinfo is just a single global variable, so I protected the cache with staticpro. But on platforms that support several displays in the same session, something else should be done to protect the cache for each instance of dpyinfo. > >> Looks to me that the font objecz could come from there. > > > > Can you tell how that could happen, with pointers to the code? > > Oh, that's a bit difficult. I went frames up, read the code to > understand where the font object might come from. Then in functions > called fromt here, and landed in something retrieving Lisp_Objects from > these drivers. One can probably find that that by looking where the > frame's driver list is used. I looked, but couldn't find it. All I see is that the driver's _type_ (a symbol) is used in font objects. Otherwise, what I see is that we invoke driver's methods, like 'list', 'match', and 'has_char', but do not use the driver struct itself in dealing with fonts.