From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Is there any possible memory leak in GC? Date: Thu, 13 Dec 2007 11:36:47 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1197563879 7339 80.91.229.12 (13 Dec 2007 16:37:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Dec 2007 16:37:59 +0000 (UTC) Cc: emacs-devel@gnu.org To: Herbert Euler Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 13 17:38:09 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J2r4Q-0007R8-Ui for ged-emacs-devel@m.gmane.org; Thu, 13 Dec 2007 17:37:59 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J2r48-0004yB-RJ for ged-emacs-devel@m.gmane.org; Thu, 13 Dec 2007 11:37:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J2r3M-0004PU-FV for emacs-devel@gnu.org; Thu, 13 Dec 2007 11:36:52 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J2r3K-0004N1-6H for emacs-devel@gnu.org; Thu, 13 Dec 2007 11:36:51 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J2r3J-0004Mq-Qb for emacs-devel@gnu.org; Thu, 13 Dec 2007 11:36:49 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J2r3J-0004Sz-9h for emacs-devel@gnu.org; Thu, 13 Dec 2007 11:36:49 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAD/uYEdMCpLM/2dsb2JhbACqRQ X-IronPort-AV: E=Sophos;i="4.24,162,1196658000"; d="scan'208";a="11359004" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 13 Dec 2007 11:36:48 -0500 Original-Received: from pastel.home ([76.10.146.204]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id SCX89047; Thu, 13 Dec 2007 11:36:47 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 76F8E7FA1; Thu, 13 Dec 2007 11:36:47 -0500 (EST) In-Reply-To: (Herbert Euler's message of "Thu, 13 Dec 2007 23:21:08 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:85128 Archived-At: > After watching the use of `cons_free_list', I am confused about it. > `cons_free_list' holds the unmarked cons cells during GC sweeping. > When `cons' creates new cons cells, it picks any ones in > `cons_free_list' if possible. But each time when sweeping happens, > `cons_free_list' is reset to 0, and its previous value is lost. Since > GC can run at any time with `garbage-collect', will this lead to > memory leak or not? No, it should not lead to any leak because it will find all the cells that were still on the cons_free_list and add them back, while sweeping the cons blocks. Stefan