From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.help Subject: Re: deleting contents of an array. Date: Tue, 11 Mar 2008 14:08:41 +0100 Organization: Chalmers University of Technology, Sweden Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1205242854 28185 80.91.229.12 (11 Mar 2008 13:40:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Mar 2008 13:40:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 11 14:41:19 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JZ4jD-0002aH-Ct for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Mar 2008 14:41:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JZ4if-00019V-4J for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Mar 2008 09:40:41 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!goblin1!goblin.stu.neva.ru!news.solace.miun.se!news.solace.miun.se!gide.ita.chalmers.se!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-NNTP-Posting-Host: remote2.student.chalmers.se Original-X-Trace: gide.ita.chalmers.se 1205240922 28018 129.16.29.80 (11 Mar 2008 13:08:42 GMT) Original-X-Complaints-To: usenet@gide.ita.chalmers.se Original-NNTP-Posting-Date: Tue, 11 Mar 2008 13:08:42 +0000 (UTC) Mail-Copies-To: never User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:4Nn2XKGPlUvCoG69blUvp91sDeo= Original-Xref: shelby.stanford.edu gnu.emacs.help:156880 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:52252 Archived-At: Michal writes: > I created vector: > (setq my-vec (make-vector 10 nil)) > > then I added marker to it. > (let ((m1 (make-marker))) > (set-marker m1 (point) (current-buffer)) > (aset my-vec 3 m1)) > > Then I decided to clean whole vector with: > (fillarray my-vec nil) > > Will garbage collector take my no longer used element, that was on > position 3 of vector, so that no memory leak will be present? Yes, but Insertion and deletion in a buffer must check all the markers and relocate them if necessary. This slows processing in a buffer with a large number of markers. For this reason, it is a good idea to make a marker point nowhere if you are sure you don't need it any more. Unreferenced markers are garbage collected eventually, but until then will continue to use time if they do point somewhere. (info "(elisp) Overview of Markers") -- Johan Bockgård