Re: Poll for information

From: George Greer (greerga@circlemud.org)
Date: 08/21/01


On Tue, 21 Aug 2001, Del wrote:

>George Greer wrote:
>>
>> So I'm investigating a method of combining objects.  Currently I have two
>> options:
>
>I can't give you numbers for a mud (I'm not running one) however I am in
>favor of adding object stacking or whatever you want to call it.

I'm not thinking of adding object stacking because it's a good feature.
I'm thinking of adding it because it's a good feature and it might clean up
otherwise self-proclaimed "hackish" code.

shop.c:

struct obj_data *slide_obj(struct obj_data * obj, struct char_data * keeper,
                                    int shop_nr)
/*
   This function is a slight hack!  To make sure that duplicate items are
   only listed once on the "list", this function groups "identical"
   objects together on the shopkeeper's inventory list.  The hack involves
   knowing how the list is put together, and manipulating the order of
   the objects on the list.  (But since most of DIKU is not encapsulated,
   and information hiding is almost never used, it isn't that big a
   deal) -JF
*/

>I will bet you already have your mind set on which method you want to use :)
>(due to past performance with your poll questions)

Really I don't.  I would prefer to use the "multiple count" (#2) method but
if that's not feasible I'll use the "sort-inventory" (#1) method.  The main
reason I don't want to use the #1 method is because of breaking the order
when modifying an object.  The downside to the #2 method is possibly
changing all of the objects instead of doing a copy-on-write like it's
supposed to, but a little mprotect() debug mode hackery can help flush
those out. Having true GET/SET-style macros would make it a trivial
change ...oh well...

I mainly want the numbers to determine the cost of adding 1/2/4-bytes to
all object data structures.  I haven't examined either possibility mentally
beyond what I've described in my e-mails.

--
George Greer
greerga@circlemud.org

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST