From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Herbert Euler Newsgroups: gmane.emacs.devel Subject: RE: Is there any possible memory leak in GC? Date: Fri, 14 Dec 2007 07:48:54 +0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1197589755 4259 80.91.229.12 (13 Dec 2007 23:49:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Dec 2007 23:49:15 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 14 00:49:24 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 1J2xnt-0000Np-18 for ged-emacs-devel@m.gmane.org; Fri, 14 Dec 2007 00:49:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J2xna-0007oM-Mh for ged-emacs-devel@m.gmane.org; Thu, 13 Dec 2007 18:49:02 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J2xnV-0007m2-Kr for emacs-devel@gnu.org; Thu, 13 Dec 2007 18:48:57 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J2xnU-0007jb-0O for emacs-devel@gnu.org; Thu, 13 Dec 2007 18:48:57 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J2xnT-0007jL-S7 for emacs-devel@gnu.org; Thu, 13 Dec 2007 18:48:55 -0500 Original-Received: from bay0-omc3-s36.bay0.hotmail.com ([65.54.246.236]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J2xnT-000050-Fq for emacs-devel@gnu.org; Thu, 13 Dec 2007 18:48:55 -0500 Original-Received: from BAY143-W7 ([65.55.154.42]) by bay0-omc3-s36.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 13 Dec 2007 15:48:54 -0800 X-Originating-IP: [221.223.209.254] Importance: Normal In-Reply-To: X-OriginalArrivalTime: 13 Dec 2007 23:48:54.0627 (UTC) FILETIME=[B86F6330:01C83DE2] X-detected-kernel: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ 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:85138 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. Ah, I have found the gap between my understanding and the fact. Thank you! :D Regards, Guanpeng Xu _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/