No, not really.
Let me elaborate:
MAKE_CONSTANT_SHARED_STRING() expands to something along these lines:
static struct pike_string *_whatever; struct pike_string *x; if( !_whatever ) whatever=create_shared_binary_string(#X,sizeof(#X)-sizeof("")); x = _whatever; add_ref( x );
Then you call free_string() when you are done with it, but note that one reference is kept in the _whatever static variable. If pike is compiled with debug, it is also added to a list of strings that are free:d when pike exists, thus avoiding memory leaks.
make_shared*_string creates a string, without the extra code.
make_shared_string in the pike_module_init function or similar initialization method is better than MAKE_CONSTANT_SHARED_STRING speed-wise, but can be somewhat harder to read at times, and there is no lazy allocation.
/ Per Hedbor ()
Previous text:
2003-01-12 18:52: Subject: Making strings
So it would be benefitial if all strings allocated during module initialization was created with MAKE_CONSTANT_SHARED_STRING?
/ Martin Nilsson (Åskblod)