Yes, it's true that the hashing does save space and that's important on shared machines. Doesn't mean it has to be that hard to use, though, and that prone to subtle yet nearly fatal errors.
I'm not sure why they use DISPOSE, which is just a fancy schmancy version of free. I think it checks against freeing a null pointer, but no programmer should be disposing a null anyways...
My solution to this was to write a C++ hashed string class that when you assign to it automatically hashes the string into the table; it also automatically removes the string from the table before that, and when you deallocate it (or when it is deallocated automatically.)
I haven't implemented it everywhere yet because I don't feel like changing all of it just now, but I will at some point. Everything I do that needs one of those uses the new version; I guess sometime I'll have to attack the rest as well. :P
When I said make everything hashed, I meant all variables that actually stick around, not those little temporary ones declared in functions. Like if you need a small buffer for just a few calls, don't bother hashing it; that would be a waste of processor time. You'd probably save a few k, which is not a big deal considering the work it would be. Then again, results will vary a lot depending on how big your MUD is.
If you use a typedef in C, can't that at least semi-solve the problem? For example, you can say:
typedef char* HashedString;
And then declare:
struct MobileStruct
{
HashedString name;
}
Will C let you use that as a normal char* or will it complain at you? I guess it depends on how strict your compiler is; I've found that gcc is not strict at all, and it's generally a much better idea to use g++, even on normal C.
For example, when I ported a Star Wars MUD to C++, without changing anything at all but moving from gcc to g++, roughly 1,000 errors (not just warnings) were generated from poor code that did very strange (and unsafe) things. I think it's good to bonk the programmer around like that, and make sure that s/he *really* knows what s/he is doing. Anyways... that's just me. :P