[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Initial frame faces
From: |
Dmitry Antipov |
Subject: |
Re: Initial frame faces |
Date: |
Mon, 27 Jan 2014 13:51:48 +0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
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