From owner-freebsd-libh Fri Nov 23 16:27:43 2001 Delivered-To: freebsd-libh@freebsd.org Received: from tomts14-srv.bellnexxia.net (tomts14.bellnexxia.net [209.226.175.35]) by hub.freebsd.org (Postfix) with ESMTP id 20B6A37B419 for ; Fri, 23 Nov 2001 16:27:39 -0800 (PST) Received: from khan.anarcat.dyndns.org ([65.94.177.56]) by tomts14-srv.bellnexxia.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with ESMTP id <20011124002738.MUXP21779.tomts14-srv.bellnexxia.net@khan.anarcat.dyndns.org> for ; Fri, 23 Nov 2001 19:27:38 -0500 Received: from shall.anarcat.dyndns.org (shall.anarcat.dyndns.org [192.168.0.1]) by khan.anarcat.dyndns.org (Postfix) with ESMTP id 587D4192E for ; Fri, 23 Nov 2001 19:29:22 -0500 (EST) Received: by shall.anarcat.dyndns.org (Postfix, from userid 1000) id 88DFF20ADB; Fri, 23 Nov 2001 19:29:06 -0500 (EST) Date: Fri, 23 Nov 2001 19:29:06 -0500 From: The Anarcat To: libh@FreeBSD.org Subject: Does one need to free H:: data structures? (Re: cvs commit: libh/release/diskedit TODO) Message-ID: <20011124002905.GB27297@shall.anarcat.dyndns.org> References: <200111151950.fAFJojw07191@usw4.freebsd.org> <20011115195849.GI2447@shall.anarcat.dyndns.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZoaI/ZTpAVc4A5k6" Content-Disposition: inline In-Reply-To: <20011115195849.GI2447@shall.anarcat.dyndns.org> User-Agent: Mutt/1.3.23.2i Sender: owner-freebsd-libh@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --ZoaI/ZTpAVc4A5k6 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu Nov 15, 2001 at 02:58:50PM -0500, The Anarcat wrote: > On Thu Nov 15, 2001 at 01:50:45PM -0600, Antoine Beaupr=E9 wrote: > > antoine 2001/11/15 13:50:45 CST > >=20 > > Modified files: > > release/diskedit TODO=20 >=20 > There is an interesting item in there, to say the least... >=20 > o free data??? >=20 > In libdisk, there are lovely things such as Free_Disk. I never actually > bothered to verify in detail, but I think there is some kind of dynamic > garbage collection in TCL, right? So the question is: >=20 > Do I need to free H:: data structures??? =46rom the tests I ran, yes, you need to free H:: data structures. I don't understand why, and IMHO, it shouldn't be that way, but it's obvious. The test program: set free [lindex $argv 0] set iter [lindex $argv 1] if {$iter =3D=3D ""} {set iter 8} for {set i 0} {$i < $iter} {incr i} { set disk [Disk "ad0"] puts "$i: $disk" if {$free} { H::delete $disk } } puts "done, press enter to finish" gets stdin Yields: anarcat@shall[~/libh]% tclh.static mem-test.tcl 1 8192 0: 0x8882d18_4Disk 1: 0x8882d18_4Disk 2: 0x8882d18_4Disk 3: 0x8882d18_4Disk 4: 0x8882d18_4Disk =2E.. UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND 1000 27368 27273 84 3 0 9512 2928 ttyin S+ p2 0:20.38 tclh.sta= tic mem-test.tcl 1 8192 and: anarcat@shall[~/libh]% tclh.static mem-test.tcl 0 8192 0: 0x8882d18_4Disk 1: 0x8886118_4Disk 2: 0x88864d8_4Disk 3: 0x8886898_4Disk 4: 0x8886c58_4Disk =2E.. UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND 1000 27383 27273 128 44 0 19784 12564 - R+ p2 0:26.04 tclh.st= atic mem-test.tcl 0 8192 I guess that settles it. A. --ZoaI/ZTpAVc4A5k6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjv+6dAACgkQttcWHAnWiGcXBACfQT3VjtUx8LcvDrvRy8p0fwPX 56gAn0EcYLLAB9V7S2vGCxvbbOigLuqh =1Hvh -----END PGP SIGNATURE----- --ZoaI/ZTpAVc4A5k6-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-libh" in the body of the message