These are *real* constant constants -- things that are constant at compile time. The source has a bunch of them scattered around. Leo put in the initial support for these things, and I've added them to some more files.

To declare a compile-time STRING constant, use the CONST_STRING macro. Takes two parameters, an interpreter pointer and a real C string constant. Note that it *must* be a constant string, no macro'd constant or variable. Looks like:

   STRING *foo = CONST_STRING(interpreter, "foobar");

The source file you put it in must have a corresponding .str file, which must be #included at the top. For example, pmc.c must have

   #include "pmc.str"

in the include section. If you add a CONST_STRING macro to a file that doesn't have one yet, you'll also want to update the STR_FILES variable in config/gen/makefiles/root.in, and add the .str file as a dependency on the $(O) target for the source file. (So you'd add $(SRC)/pmc.str as a dependency for $(SRC)/pmc$(O))

This should drop memory usage down some (unless I broke something) since there'll be a single string header and body for each unique constant string. That way we won't keep recreating these things for each usage. (Which, since each delegated method call creates one, can be not insignificant)
--
Dan


--------------------------------------it's like this-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to