--- JSON-XS/XS.xs 2007/08/13 16:06:25 1.58 +++ JSON-XS/XS.xs 2007/08/13 16:14:20 1.59 @@ -62,8 +62,10 @@ #ifdef USE_ITHREADS # define JSON_SLOW 1 +# define JSON_STASH (json_stash ? json_stash : gv_stashpv ("JSON::XS", 1)) #else # define JSON_SLOW 0 +# define JSON_STASH json_stash #endif static HV *json_stash, *json_boolean_stash; // JSON::XS:: @@ -1380,14 +1382,11 @@ void new (char *klass) PPCODE: { - HV *stash = !JSON_SLOW || json_stash - ? json_stash - : gv_stashpv ("JSON::XS", 1); SV *pv = NEWSV (0, sizeof (JSON)); SvPOK_only (pv); Zero (SvPVX (pv), 1, JSON); ((JSON *)SvPVX (pv))->flags = F_DEFAULT; - XPUSHs (sv_2mortal (sv_bless (newRV_noinc (pv), stash))); + XPUSHs (sv_2mortal (sv_bless (newRV_noinc (pv), JSON_STASH))); } void ascii (JSON *self, int enable = 1)