[Coldstuff] First version of waif-patch

Bruce Mitchener bruce@cubik.org
Thu, 03 Jan 2002 23:00:56 -0700


xmath wrote:

> Here's a first version of the waif patch
> 
> it's not totally done yet, but you can already play with it an see how I 
> implemented the overall structure. Now would be the time for feedback :-)


I didn't try running this patch.  I've only read it and am providing 
feedback based on that.

The architecture for adding waif support that you've used in this patch 
adds overhead both in terms of memory usage and execution speed for the 
typical object.  The use of ExtObj isn't something that will work for 
those reasons.

One possibility might be to use structs that have the same layout for 
the shared portions and then to do some type casting. Another might be 
to look at just having a new thing in the cData union and a separate 
struct altogether.  There are likely other possibilities.  I'd like to 
see some discussion of how that will be structured and written 
(preferably here on this list since I'm not on the Cold Dark a lot of 
the time that you are due to timezones, etc).

Also, negative object numbers happen when an object becomes invalid. 
(So, #2 becomes #-2 if you destroy it.)  So, the changes to how objnums 
are compared doesn't look correct to me.

The things that return ~waif when there is an error should return ~type 
usually.  ~type indicates that something wasn't of the correct ~type and 
is something that code can and should be able to expect.

Finally, if you're changing the indentation level with a part of your 
patch, please make sure that you fully correct the indentation level in 
the surrounding code.

There are various small changes that I have questions about or that 
looked like they didn't really belong here in this patch. (Due to being 
entirely unrelated.)  Once we're through some of the structural 
discussion, and there's a new draft patch, we can return to some of 
those things.

Cheers,

  - Bruce