On Tue, Jul 5, 2011 at 15:46, Lazaridis Ilias <ilias / lazaridis.com> wrote:

> * I do not use a "C global variable", but a class-object variable.
> * There is no "global status", but a class-object status.

The point is that it”Ēs still a global.

But that”Ēs really beside the point.  Why even have
#call_initialize/#call_initialize=?  Simply  always invoke #initialize
instead:

diff --git a/string.c b/string.c
index 711918b..8bdf650 100644
--- a/string.c
+++ b/string.c
@@ -409,7 +409,11 @@ str_new(VALUE klass, const char *ptr, long len)
 VALUE
 rb_str_new(const char *ptr, long len)
 {
-    return str_new(rb_cString, ptr, len);
+    VALUE str = str_new(rb_cString, ptr, len);
+
+    rb_obj_call_init(str, 1, &str);
+
+    return str;
 }

 VALUE

I suspect that this modification (in whatever form it eventually ends
up being) should also be done to rb_str_new_with_class().