Re: Re[2]: [CODE][OLC][?] Deleting

From: Gary Barnett (gbarnett@POLARNET.COM)
Date: 07/27/97


On Sunday, July 27, 1997 2:51 PM, Daniel Houghton
[SMTP:danielh@STIMPY.CNU.EDU] wrote:
> > Ron Cole <roncole@SHORE.INTERCOM.NET> wrote:
> > Pay me now, or pay me later, but sooner or later you gotta pay :-)
> >
> > Space for the new field would be allocated for every prototype AND
> > every instance.. wasteful.. Better to use the flag... or you could
> > create a linked-list of vnums to delete..  Still better than a byte for
> > each prototype.
>
>   Okay, perhaps I'm missing something.
>
>   Boolean variables only hold values of 0 or 1... thus, they should
> require only one bit of memory... correct?  That seems minimal enough.
>
>   If I am at all on the right track here, that should mean that a
> structure containing boolean variables should be an efficient means
> of storing flags.

The point was that if you don't want to use the flag concept that you are
stuck with allocating another minimum size memory storage location,
which is a byte. You can't allocate a boolean with ansi c, AFAIK.

So.. Use an existing data location with a spare flag, or create a new
place to store data, and reserving 7 (or more) of those bits for flags later.

Seeing as this flag is ostensibly to mark the fact that something is deleted
and will be going away, it has no dependencies. You could define it anywhere
there is a list of bits to set.

You could also create a linked list of things to not save and then have the
save routine pop them off the list as it skips them.  Though this would be
more code...

>
>   Okay, given that people are going through all the trouble to do
> bitfields or bitvectors, I must be missing something.
>
It was in response to the idea that a seperate var should handle it I
believe, though I'm not going to go look at all the messages in an
attempt to find out for sure.

--Mallory :-)"Never worry about the bullet with your name on it. Instead,
worry about
shrapnel addressed to 'occupant.'" --Murphy


     +------------------------------------------------------------+
     | 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/08/00 PST