No that is not allowed. make_static_string() is an internal API to create string with static storage (e.g. compile time constant strings). If you want to pass this string to pike code you need to use make_shared_static_string() which creates a "normal" Pike string.
What use-case do you have?
Simple, actually. I'm doing some Shuffler fixing again, and noticed that I have to create very temporary strings out of the various source objects and then pass them to a write() method. Those strings are not hashed in most cases and it would be a waste to make them a shared string only to remove them again from the shared string pool a few microseconds later.
I.e. this is the code I am contemplating:
struct pike_string *s = make_static_string(iov[i].iov_base, iov[i].iov_len, 0); push_string(s); apply (t->file_obj, "write", 1); pop_stack();
It seems to be a valid use case, since I provide the iov array and the source of the strings. The source will stay put while the write method runs, and I'll take care of freeing the source myself after the pop_stack(). So, yes, the only thing I need is some window dressing so that the string can be accessed from the Pike stack, and supposedly can be freed there, which should not touch the strings itself.