1997Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Garbage Collector -->
<!--X-From-R13: "Oeghe 'Drivabe' Pvrfvnqbjfxv" <novrfNct.tqn.cy> -->
<!--X-Date: from mars.pobox.org.sg [203.116.23.195] by mx01.ca.us.ibm.net id 858895961.10590&#45;1 Thu Mar 20 22:12:41 1997 -->
<!--X-Message-Id: Pine.GSO.3.96L01AT.970320210925.10529B&#45;100000@sunrise -->
<!--X-Content-Type: text/plain -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Garbage Collector</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:abies#pg,gda.pl">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00156.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00158.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00207.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00156.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00155">Author</A>
&nbsp;|&nbsp;<A HREF="#00155">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00155">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Garbage Collector</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: Mud++ Mail List &lt;<A HREF="mailto:mudpp-list#mailhost,net">mudpp-list#mailhost,net</A>&gt;</LI>
<LI><em>Subject</em>: Garbage Collector</LI>
<LI><em>From</em>: "Artur 'Revinor' Biesiadowski" &lt;<A HREF="mailto:abies#pg,gda.pl">abies#pg,gda.pl</A>&gt;</LI>
<LI><em>Date</em>: Thu, 20 Mar 1997 21:09:49 +0100 (MET)</LI>
<LI><em>cc</em>: "Mr. Jolt Cola" &lt;<A HREF="mailto:msmith#quix,robins.af.mil">msmith#quix,robins.af.mil</A>&gt;</LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
Patch is at
<A  HREF="http://www.pg.gda.pl/~abies/mudpp/patches/art026a.dif">http://www.pg.gda.pl/~abies/mudpp/patches/art026a.dif</A>
(Fusion - I sent it by mail)

NOTE: it is not complete work ! It is only glimpse at my work to keep you
up to date, allow to flame me for bad constructs and share ideas.

It adds automatic garbage collector to mud++.

How this work:
Some of the classes now inherit from VMObject (VirtualMachineObject)
(this include MudObject, Affect, Exit, Repop and some more)
Every instance has it own private reference counter. When we put pointer
to it in some table (for example LList) we have to increase counter by one
( obj-&gt;getHandle() ). If we dereference it somewhen later just reduce counter
by obj-&gt;freeHandle(). This apply only to direct pointer handling, as I have
already put most needed calls to top-level funs like rmObjInv() (as opposed
to inv.remove(obj) )
No more delete - just remember to dereference objects correctly and GC
will take care of this later.
GC keeps list of all VMObjects and when it is fired up it scans list for
objects with 0 count. When such objects is spotted it is deleted.

NOTE: this desing of GC is not good for multithreaded environement.
I'm not sure how to solve this - maybe we will need separate GC for each tread?
Neverless, it is future.

Why we need GC ?
It is NOT made to make life easier, but to make some otherwise impossible
things doable. True functionality of GC will show up in VM environement - we
will be able to operate on VM variables without fear that object will be deleted
during some wait/sleep statement.

For now GC is infant, it has many bugs with referencing/dereferencing
(at least one in shellpcs), and it will crash when you will allocate too many
objects (I'm fixing it at the moment).
If you want to play with it there are two commands (besides gdb:)
gcdump - dumps GC stack to logfile (in format type_of_object : count )
gcrun - delete items with 0 reference count
(Hint: your items and goblin + his items are at end of dump)
I'm working hard to correct this and later I will start to port/rewrite
my old Virtual Machine and MudAsm.
I also have to put String, LList, Array and Hashtable to GC - but they will
be handled in other way (or not - I'm not sure)

OK, that was long, enough :)
If you have any questions ask. (I will have to write some doc about this :(
Or maybe you are just totally against GC ? It would save me some work :)

Artur


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00156.html">EVOLUTION response</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00158.html">Re: Resets and repops</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00207.html">A perspective out of time - the mudreport document</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00156.html">EVOLUTION response</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00155"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00155"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>Re: Mixture</STRONG>, <EM>(continued)</EM>
<ul compact>
<LI><strong><A NAME="00269" HREF="msg00269.html">Re: Mixture</A></strong>, 
claw <a href="mailto:claw#null,net">claw#null,net</a>, Tue 01 Apr 1997, 09:43 GMT
</LI>
</ul>
</LI>
<LI><strong><A NAME="00187" HREF="msg00187.html">Old missing posts from old list</A></strong>, 
coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Mon 24 Mar 1997, 01:30 GMT
<LI><strong><A NAME="00168" HREF="msg00168.html">A perspective out of time - the mudreport document</A></strong>, 
Nathan Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Sat 22 Mar 1997, 10:19 GMT
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00207" HREF="msg00207.html">A perspective out of time - the mudreport document</A></strong>, 
claw <a href="mailto:claw#null,net">claw#null,net</a>, Wed 26 Mar 1997, 01:20 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00155" HREF="msg00155.html">Garbage Collector</A></strong>, 
Artur 'Revinor' Biesiadowski <a href="mailto:abies#pg,gda.pl">abies#pg,gda.pl</a>, Fri 21 Mar 1997, 06:12 GMT
<LI><strong><A NAME="00156" HREF="msg00156.html">EVOLUTION response</A></strong>, 
claw <a href="mailto:claw#null,net">claw#null,net</a>, Fri 21 Mar 1997, 05:44 GMT
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00172" HREF="msg00172.html">Re: EVOLUTION response</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Sat 22 Mar 1997, 14:20 GMT
</LI>
<LI><strong><A NAME="00208" HREF="msg00208.html">Re: EVOLUTION response</A></strong>, 
claw <a href="mailto:claw#null,net">claw#null,net</a>, Wed 26 Mar 1997, 01:43 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00147" HREF="msg00147.html">Sorry for the dups (again)</A></strong>, 
coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Thu 20 Mar 1997, 12:38 GMT
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>