Re: Use Less RAM! 1998 at 04:48:54PM +0000

From: Eric Green (ejg3@CORNELL.EDU)
Date: 02/23/98


On Sun, Feb 22, 1998 at 04:48:54PM +0000, Daniel Houghton wrote:
>
> Daniel Koepke has a valid point.  Another approach you could try is investigating
> the Death Gate code (at ftp.imaxx.net/~thrytis) for its use of a
> shared string manager.  In short, most any lenthy description is stored in one
> central table along with a counter of how many things use it (objects, mobs,
> rooms, doesn't matter).  This means that you'll save memory on anything
> redundant, and that you could code a change of description for an individual
> mobile, for example, without messing with the prototype - which you could use to
> say, code a beefed-up animate dead spell.

DG's shared string manager doesn't really provide a savings of memory over
Circle's method of sharing strings.  It was done to make a safer interface
to sharing strings for my OLC (it reduces memory leaks or freeing a shared
string too early).  It also simplifies string sharing elsewhere (like
the animate dead spell mentioned above).

If you're looking for a shared string manager which will reduce memory,
check out the version in the Forbidden Lands code at
http://www.imaxx.net/~thrytis/fl.  This if a new string is created
and is already in the game (perhaps in a totally unrelated description)
then the string is shared.  You don't have to ss_share the string
to get the benifit.

Eric


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST