… | |
… | |
61 | #define expect_true(expr) expect ((expr) != 0, 1) |
61 | #define expect_true(expr) expect ((expr) != 0, 1) |
62 | |
62 | |
63 | #ifdef USE_ITHREADS |
63 | #ifdef USE_ITHREADS |
64 | # define JSON_SLOW 1 |
64 | # define JSON_SLOW 1 |
65 | #else |
65 | #else |
66 | # define JSON_SLOW 1 |
66 | # define JSON_SLOW 0 |
67 | #endif |
67 | #endif |
68 | |
68 | |
69 | static HV *json_stash, *json_boolean_stash; // JSON::XS:: |
69 | static HV *json_stash, *json_boolean_stash; // JSON::XS:: |
70 | static SV *json_true, *json_false; |
70 | static SV *json_true, *json_false; |
71 | |
71 | |
… | |
… | |
510 | // we re-bless the reference to get overload and other niceties right |
510 | // we re-bless the reference to get overload and other niceties right |
511 | GV *to_json = gv_fetchmethod_autoload (SvSTASH (sv), "TO_JSON", 0); |
511 | GV *to_json = gv_fetchmethod_autoload (SvSTASH (sv), "TO_JSON", 0); |
512 | |
512 | |
513 | if (to_json) |
513 | if (to_json) |
514 | { |
514 | { |
515 | int count; |
|
|
516 | dSP; |
515 | dSP; |
517 | |
516 | |
518 | ENTER; SAVETMPS; PUSHMARK (SP); |
517 | ENTER; SAVETMPS; PUSHMARK (SP); |
519 | XPUSHs (sv_bless (sv_2mortal (newRV_inc (sv)), SvSTASH (sv))); |
518 | XPUSHs (sv_bless (sv_2mortal (newRV_inc (sv)), SvSTASH (sv))); |
520 | |
519 | |