From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Antipov Newsgroups: gmane.emacs.devel Subject: Re: Initial frame faces Date: Mon, 27 Jan 2014 13:51:48 +0400 Message-ID: <52E62C34.1020209@yandex.ru> References: <52E201ED.1080108@yandex.ru> <83iot9eryn.fsf@gnu.org> <52E22697.9000901@yandex.ru> <83d2jheoh4.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1390816329 8522 80.91.229.3 (27 Jan 2014 09:52:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Jan 2014 09:52:09 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 27 10:52:16 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W7irY-0006cL-4Y for ged-emacs-devel@m.gmane.org; Mon, 27 Jan 2014 10:52:16 +0100 Original-Received: from localhost ([::1]:58617 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7irX-0003zz-NX for ged-emacs-devel@m.gmane.org; Mon, 27 Jan 2014 04:52:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7irO-0003zu-Mb for emacs-devel@gnu.org; Mon, 27 Jan 2014 04:52:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7irH-0003V3-MN for emacs-devel@gnu.org; Mon, 27 Jan 2014 04:52:06 -0500 Original-Received: from forward1l.mail.yandex.net ([84.201.143.144]:52485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7irA-0003Uc-5i; Mon, 27 Jan 2014 04:51:52 -0500 Original-Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [37.140.190.28]) by forward1l.mail.yandex.net (Yandex) with ESMTP id E0D141520DC1; Mon, 27 Jan 2014 13:51:49 +0400 (MSK) Original-Received: from smtp3o.mail.yandex.net (localhost [127.0.0.1]) by smtp3o.mail.yandex.net (Yandex) with ESMTP id 89DA11E0E83; Mon, 27 Jan 2014 13:51:49 +0400 (MSK) Original-Received: from unknown (unknown [37.139.80.10]) by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id SyGIWD2GNa-pngeWhp2; Mon, 27 Jan 2014 13:51:49 +0400 (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (Client certificate not present) X-Yandex-Uniq: 85b0a9c6-893c-4a70-b600-d002195305c0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1390816309; bh=oqBJpvfwmA18+INikUALmPH9g1jHIO876gTvpYEVJlM=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=Y52xECeOuvM89JqU5Q85sMLbp/mf6uMygJkKyBIVIJmJqAnpeuGeIE+FlvkhVIgpZ w2KbWbxbIFKo3L5N8msTMPoKCpxBVLhGqkinuG9hBKzrTeIcZ1eEqdy/99IhbQBgHh bz2WLOmhP2/zQ3qARkf4DNjdh/jmR1AwafuXIOMU= Authentication-Results: smtp3o.mail.yandex.net; dkim=pass header.i=@yandex.ru User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: <83d2jheoh4.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 84.201.143.144 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:169162 Archived-At: On 01/24/2014 01:08 PM, Eli Zaretskii wrote: > But perhaps we should step back a notch and discuss the original > problem. What problem(s) did you want to solve, exactly? The problem is that free_frame_faces is never called when an initial frame is deleted. With valgrind, this is reported as memory leak: ==19033== 12,088 (40 direct, 12,048 indirect) bytes in 1 blocks are definitely lost in loss record 11,087 of 11,232 ==19033== at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==19033== by 0x5E1179: xmalloc (alloc.c:677) ==19033== by 0x51B43A: make_face_cache (xfaces.c:4202) ==19033== by 0x512D36: init_frame_faces (xfaces.c:666) ==19033== by 0x428442: make_initial_frame (frame.c:576) ==19033== by 0x4BA3ED: init_window_once (window.c:7096) ==19033== by 0x565B01: main (emacs.c:1201) IIUC this may be fixed in three ways: 1) If an initial frame is never used to display anything, we don't need faces on that frame at all. 2) initial_terminal should have a hook to free faces on an initial frame. 3) If each frame always has a face cache, it's reasonable to call free_frame_faces in delete_frame and not in frame type-specific hooks. Dmitry