Subject: bug#21556: 25.0.50; Memory leak in emacs -Q with lucid (font)

From: Dima Kogan <[email-masked]>
Date: Thu, 24 Sep 2015 23:57:00 -0700

Eli Zaretskii <[email-masked]> writes:

>> Is there a way to put a watchpoint on a lisp object? How?
>
> Depends on the object.  Which object do you want to put the watchpoint
> on?  Please show its source variable name and the source file lines
> where it is used.  Also, if the object is complex, what kinds of
> changes in it would you like to watch?

The object is the emacs font cache. Specifically in this case (Debian,
X11, xft fonts, lucid widgets) it is

  frame->output_data.x->display_info->name_list_element

where frame is a struct frame*, such as the first argument of

  font_load_for_lface()

In the original message for this bug report I showed 'pp' output for
this first argument of font_load_for_lface(). This function is called 4
times during the creation of one frame. I want to know why the font
cache is cleared before the 3rd call. I tried to examine the code, and
to place breakpoints in places that could be performing this cache
clear, but none of those places look like the right ones. If a
watchpoint is possible, it would tell me where this is cleared, instead
of me having to guess.