| 1 |
|
| /* |
| 2 |
|
| * This file was generated automatically by XS::Install::FrozenShit::ParseXS version 3.57 from the |
| 3 |
|
| * contents of MyTest.xs. Do not edit this file, edit MyTest.xs instead. |
| 4 |
|
| * |
| 5 |
|
| * ANY CHANGES MADE HERE WILL BE LOST! |
| 6 |
|
| * |
| 7 |
|
| */ |
| 8 |
|
| |
| 9 |
|
| #line 1 "t/lib/MyTest.xs" |
| 10 |
|
| #include <xs.h> |
| 11 |
|
| #include <xs/date.h> |
| 12 |
|
| #include <xs/Scope.h> |
| 13 |
|
| #include <panda/date.h> |
| 14 |
|
| #include <cstring> |
| 15 |
|
| |
| 16 |
|
| using namespace xs; |
| 17 |
|
| using namespace panda::date; |
| 18 |
|
| using panda::string; |
| 19 |
|
| using panda::string_view; |
| 20 |
|
| |
| 21 |
|
| #if !defined(_WIN32) && !defined(sun) && !defined(__sun) |
| 22 |
|
| #define DATE_TEST_SYS |
| 23 |
|
| #endif |
| 24 |
|
| |
| 25 |
|
| |
| 26 |
|
| #line 27 "t/lib/MyTest_xsgen.cc" |
| 27 |
|
| #ifndef PERL_UNUSED_VAR |
| 28 |
|
| # define PERL_UNUSED_VAR(var) if (0) var = var |
| 29 |
|
| #endif |
| 30 |
|
| |
| 31 |
|
| #ifndef dVAR |
| 32 |
|
| # define dVAR dNOOP |
| 33 |
|
| #endif |
| 34 |
|
| |
| 35 |
|
| |
| 36 |
|
| /* This stuff is not part of the API! You have been warned. */ |
| 37 |
|
| #ifndef PERL_VERSION_DECIMAL |
| 38 |
|
| # define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s) |
| 39 |
|
| #endif |
| 40 |
|
| #ifndef PERL_DECIMAL_VERSION |
| 41 |
|
| # define PERL_DECIMAL_VERSION \ |
| 42 |
|
| PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION) |
| 43 |
|
| #endif |
| 44 |
|
| #ifndef PERL_VERSION_GE |
| 45 |
|
| # define PERL_VERSION_GE(r,v,s) \ |
| 46 |
|
| (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s)) |
| 47 |
|
| #endif |
| 48 |
|
| #ifndef PERL_VERSION_LE |
| 49 |
|
| # define PERL_VERSION_LE(r,v,s) \ |
| 50 |
|
| (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s)) |
| 51 |
|
| #endif |
| 52 |
|
| |
| 53 |
|
| /* XS_INTERNAL is the explicit static-linkage variant of the default |
| 54 |
|
| * XS macro. |
| 55 |
|
| * |
| 56 |
|
| * XS_EXTERNAL is the same as XS_INTERNAL except it does not include |
| 57 |
|
| * "STATIC", ie. it exports XSUB symbols. You probably don't want that |
| 58 |
|
| * for anything but the BOOT XSUB. |
| 59 |
|
| * |
| 60 |
|
| * See XSUB.h in core! |
| 61 |
|
| */ |
| 62 |
|
| |
| 63 |
|
| |
| 64 |
|
| /* TODO: This might be compatible further back than 5.10.0. */ |
| 65 |
|
| #if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1) |
| 66 |
|
| # undef XS_EXTERNAL |
| 67 |
|
| # undef XS_INTERNAL |
| 68 |
|
| # if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING) |
| 69 |
|
| # define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name) |
| 70 |
|
| # define XS_INTERNAL(name) STATIC XSPROTO(name) |
| 71 |
|
| # endif |
| 72 |
|
| # if defined(__SYMBIAN32__) |
| 73 |
|
| # define XS_EXTERNAL(name) EXPORT_C XSPROTO(name) |
| 74 |
|
| # define XS_INTERNAL(name) EXPORT_C STATIC XSPROTO(name) |
| 75 |
|
| # endif |
| 76 |
|
| # ifndef XS_EXTERNAL |
| 77 |
|
| # if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus) |
| 78 |
|
| # define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__) |
| 79 |
|
| # define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__) |
| 80 |
|
| # else |
| 81 |
|
| # ifdef __cplusplus |
| 82 |
|
| # define XS_EXTERNAL(name) extern "C" XSPROTO(name) |
| 83 |
|
| # define XS_INTERNAL(name) static XSPROTO(name) |
| 84 |
|
| # else |
| 85 |
|
| # define XS_EXTERNAL(name) XSPROTO(name) |
| 86 |
|
| # define XS_INTERNAL(name) STATIC XSPROTO(name) |
| 87 |
|
| # endif |
| 88 |
|
| # endif |
| 89 |
|
| # endif |
| 90 |
|
| #endif |
| 91 |
|
| |
| 92 |
|
| /* perl >= 5.10.0 && perl <= 5.15.1 */ |
| 93 |
|
| |
| 94 |
|
| |
| 95 |
|
| /* The XS_EXTERNAL macro is used for functions that must not be static |
| 96 |
|
| * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL |
| 97 |
|
| * macro defined, the best we can do is assume XS is the same. |
| 98 |
|
| * Dito for XS_INTERNAL. |
| 99 |
|
| */ |
| 100 |
|
| #ifndef XS_EXTERNAL |
| 101 |
|
| # define XS_EXTERNAL(name) XS(name) |
| 102 |
|
| #endif |
| 103 |
|
| #ifndef XS_INTERNAL |
| 104 |
|
| # define XS_INTERNAL(name) XS(name) |
| 105 |
|
| #endif |
| 106 |
|
| |
| 107 |
|
| /* Now, finally, after all this mess, we want an XS::Install::FrozenShit::ParseXS |
| 108 |
|
| * internal macro that we're free to redefine for varying linkage due |
| 109 |
|
| * to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use |
| 110 |
|
| * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to! |
| 111 |
|
| */ |
| 112 |
|
| |
| 113 |
|
| #undef XS_EUPXS |
| 114 |
|
| #if defined(PERL_EUPXS_ALWAYS_EXPORT) |
| 115 |
|
| # define XS_EUPXS(name) XS_EXTERNAL(name) |
| 116 |
|
| #else |
| 117 |
|
| /* default to internal */ |
| 118 |
|
| # define XS_EUPXS(name) XS_INTERNAL(name) |
| 119 |
|
| #endif |
| 120 |
|
| |
| 121 |
|
| #ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE |
| 122 |
|
| #define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params) |
| 123 |
|
| |
| 124 |
|
| /* prototype to pass -Wmissing-prototypes */ |
| 125 |
|
| STATIC void |
| 126 |
|
| S_croak_xs_usage(const CV *const cv, const char *const params); |
| 127 |
|
| |
| 128 |
|
| STATIC void |
| 129 |
|
| S_croak_xs_usage(const CV *const cv, const char *const params) |
| 130 |
|
| { |
| 131 |
|
| const GV *const gv = CvGV(cv); |
| 132 |
|
| |
| 133 |
|
| PERL_ARGS_ASSERT_CROAK_XS_USAGE; |
| 134 |
|
| |
| 135 |
|
| if (gv) { |
| 136 |
|
| const char *const gvname = GvNAME(gv); |
| 137 |
|
| const HV *const stash = GvSTASH(gv); |
| 138 |
|
| const char *const hvname = stash ? HvNAME(stash) : NULL; |
| 139 |
|
| |
| 140 |
|
| if (hvname) |
| 141 |
|
| Perl_croak_nocontext("Usage: %s::%s(%s)", hvname, gvname, params); |
| 142 |
|
| else |
| 143 |
|
| Perl_croak_nocontext("Usage: %s(%s)", gvname, params); |
| 144 |
|
| } else { |
| 145 |
|
| /* Pants. I don't think that it should be possible to get here. */ |
| 146 |
|
| Perl_croak_nocontext("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params); |
| 147 |
|
| } |
| 148 |
|
| } |
| 149 |
|
| #undef PERL_ARGS_ASSERT_CROAK_XS_USAGE |
| 150 |
|
| |
| 151 |
|
| #define croak_xs_usage S_croak_xs_usage |
| 152 |
|
| |
| 153 |
|
| #endif |
| 154 |
|
| |
| 155 |
|
| /* NOTE: the prototype of newXSproto() is different in versions of perls, |
| 156 |
|
| * so we define a portable version of newXSproto() |
| 157 |
|
| */ |
| 158 |
|
| #ifdef newXS_flags |
| 159 |
|
| #define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0) |
| 160 |
|
| #else |
| 161 |
|
| #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv) |
| 162 |
|
| #endif /* !defined(newXS_flags) */ |
| 163 |
|
| |
| 164 |
|
| #if PERL_VERSION_LE(5, 21, 5) |
| 165 |
|
| # define newXS_deffile(a,b) Perl_newXS(aTHX_ a,b,file) |
| 166 |
|
| #else |
| 167 |
|
| # define newXS_deffile(a,b) Perl_newXS_deffile(aTHX_ a,b) |
| 168 |
|
| #endif |
| 169 |
|
| |
| 170 |
|
| /* simple backcompat versions of the TARGx() macros with no optimisation */ |
| 171 |
|
| #ifndef TARGi |
| 172 |
|
| # define TARGi(iv, do_taint) sv_setiv_mg(TARG, iv) |
| 173 |
|
| # define TARGu(uv, do_taint) sv_setuv_mg(TARG, uv) |
| 174 |
|
| # define TARGn(nv, do_taint) sv_setnv_mg(TARG, nv) |
| 175 |
|
| #endif |
| 176 |
|
| |
| 177 |
|
| #line 178 "t/lib/MyTest_xsgen.cc" |
| 178 |
|
| |
| 179 |
|
| |
| 180 |
0 |
▶ | XS_EUPXS(XS_MyTest_bench_parse) { xs::throw_guard(cv, [=]() |
Branch: 1 branch
| Branch | True | False | Total |
| XS_EUPXS(XS_MyTest_bench_parse) { xs::throw_guard(cv, [=]() |
0 |
0 |
0 |
|
| 181 |
|
| { |
| 182 |
0 |
| dVAR; dXSARGS; |
| 183 |
0 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
0 |
0 |
|
| 184 |
0 |
| croak_xs_usage(cv, "str"); |
| 185 |
|
| PERL_UNUSED_VAR(ax); /* -Wall */ |
| 186 |
0 |
| SP -= items; |
| 187 |
|
| { |
| 188 |
0 |
| string_view str; |
| 189 |
|
| |
| 190 |
|
| { STRLEN __str_len; |
| 191 |
0 |
| const char* __str_buf = SvPV(ST(0), __str_len); |
| 192 |
0 |
▶ | str = decltype(str)(__str_buf, __str_len); } |
Branch: 1 branch
| Branch | True | False | Total |
| str = decltype(str)(__str_buf, __str_len); } |
0 |
0 |
0 |
|
| 193 |
|
| ; |
| 194 |
|
| #line 21 "t/lib/MyTest.xs" |
| 195 |
|
| Date date; |
| 196 |
|
| for (int i = 0; i < 1000; ++i) date.set(str); |
| 197 |
|
| #line 198 "t/lib/MyTest_xsgen.cc" |
| 198 |
0 |
| PUTBACK; |
| 199 |
0 |
| return; |
| 200 |
0 |
| } |
| 201 |
0 |
| }); } |
| 202 |
|
| |
| 203 |
|
| |
| 204 |
|
| |
| 205 |
0 |
▶ | XS_EUPXS(XS_MyTest_bench_rparse) { xs::throw_guard(cv, [=]() |
Branch: 1 branch
| Branch | True | False | Total |
| XS_EUPXS(XS_MyTest_bench_rparse) { xs::throw_guard(cv, [=]() |
0 |
0 |
0 |
|
| 206 |
|
| { |
| 207 |
0 |
| dVAR; dXSARGS; |
| 208 |
0 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
0 |
0 |
|
| 209 |
0 |
| croak_xs_usage(cv, "str"); |
| 210 |
|
| PERL_UNUSED_VAR(ax); /* -Wall */ |
| 211 |
0 |
| SP -= items; |
| 212 |
|
| { |
| 213 |
0 |
| string_view str; |
| 214 |
|
| |
| 215 |
|
| { STRLEN __str_len; |
| 216 |
0 |
| const char* __str_buf = SvPV(ST(0), __str_len); |
| 217 |
0 |
▶ | str = decltype(str)(__str_buf, __str_len); } |
Branch: 1 branch
| Branch | True | False | Total |
| str = decltype(str)(__str_buf, __str_len); } |
0 |
0 |
0 |
|
| 218 |
|
| ; |
| 219 |
|
| #line 26 "t/lib/MyTest.xs" |
| 220 |
|
| DateRel rel; |
| 221 |
|
| for (int i = 0; i < 1000; ++i) rel = str; |
| 222 |
|
| #line 223 "t/lib/MyTest_xsgen.cc" |
| 223 |
0 |
| PUTBACK; |
| 224 |
0 |
| return; |
| 225 |
0 |
| } |
| 226 |
0 |
| }); } |
| 227 |
|
| |
| 228 |
|
| |
| 229 |
|
| |
| 230 |
0 |
▶ | XS_EUPXS(XS_MyTest_bench_strftime) { xs::throw_guard(cv, [=]() |
Branch: 1 branch
| Branch | True | False | Total |
| XS_EUPXS(XS_MyTest_bench_strftime) { xs::throw_guard(cv, [=]() |
0 |
0 |
0 |
|
| 231 |
|
| { |
| 232 |
0 |
| dVAR; dXSARGS; |
| 233 |
0 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
0 |
0 |
|
| 234 |
0 |
| croak_xs_usage(cv, "format"); |
| 235 |
|
| { |
| 236 |
|
| uint64_t RETVAL; |
| 237 |
0 |
▶ | dXSTARG; |
Branch: 2 branches
| Branch | True | False | Total |
| dXSTARG; |
0 |
0 |
0 |
| dXSTARG; |
0 |
0 |
0 |
|
| 238 |
0 |
| string_view format; |
| 239 |
|
| |
| 240 |
|
| { STRLEN __format_len; |
| 241 |
0 |
| const char* __format_buf = SvPV(ST(0), __format_len); |
| 242 |
0 |
▶ | format = decltype(format)(__format_buf, __format_len); } |
Branch: 1 branch
| Branch | True | False | Total |
| format = decltype(format)(__format_buf, __format_len); } |
0 |
0 |
0 |
|
| 243 |
|
| ; |
| 244 |
|
| #line 31 "t/lib/MyTest.xs" |
| 245 |
|
| auto date = Date::now(); |
| 246 |
|
| RETVAL = 0; |
| 247 |
|
| |
| 248 |
|
| for (int i = 0; i < 1000; ++i) { |
| 249 |
|
| auto res = date.strftime(format); |
| 250 |
|
| RETVAL += res.length(); |
| 251 |
|
| } |
| 252 |
|
| #line 253 "t/lib/MyTest_xsgen.cc" |
| 253 |
0 |
▶ | TARGu((UV)RETVAL, 1); |
Branch: 2 branches
| Branch | True | False | Total |
| TARGu((UV)RETVAL, 1); |
0 |
0 |
0 |
| TARGu((UV)RETVAL, 1); |
0 |
0 |
0 |
|
| 254 |
0 |
| ST(0) = TARG; |
| 255 |
0 |
| } |
| 256 |
0 |
| XSRETURN(1); |
| 257 |
0 |
| }); } |
| 258 |
|
| |
| 259 |
|
| |
| 260 |
|
| |
| 261 |
0 |
▶ | XS_EUPXS(XS_MyTest_bench_tzget) { xs::throw_guard(cv, [=]() |
Branch: 1 branch
| Branch | True | False | Total |
| XS_EUPXS(XS_MyTest_bench_tzget) { xs::throw_guard(cv, [=]() |
0 |
0 |
0 |
|
| 262 |
|
| { |
| 263 |
0 |
| dVAR; dXSARGS; |
| 264 |
0 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
0 |
0 |
|
| 265 |
0 |
| croak_xs_usage(cv, "tz"); |
| 266 |
|
| { |
| 267 |
|
| uint64_t RETVAL; |
| 268 |
0 |
▶ | dXSTARG; |
Branch: 2 branches
| Branch | True | False | Total |
| dXSTARG; |
0 |
0 |
0 |
| dXSTARG; |
0 |
0 |
0 |
|
| 269 |
0 |
| string_view tz; |
| 270 |
|
| |
| 271 |
|
| { STRLEN __tz_len; |
| 272 |
0 |
| const char* __tz_buf = SvPV(ST(0), __tz_len); |
| 273 |
0 |
| tz = decltype(tz)(__tz_buf, __tz_len); } |
| 274 |
|
| ; |
| 275 |
|
| #line 41 "t/lib/MyTest.xs" |
| 276 |
|
| RETVAL = 0; |
| 277 |
|
| for (int i = 0; i < 1000; ++i) RETVAL += (uint64_t)panda::time::tzget(tz).get(); |
| 278 |
|
| #line 279 "t/lib/MyTest_xsgen.cc" |
| 279 |
0 |
▶ | TARGu((UV)RETVAL, 1); |
Branch: 2 branches
| Branch | True | False | Total |
| TARGu((UV)RETVAL, 1); |
0 |
0 |
0 |
| TARGu((UV)RETVAL, 1); |
0 |
0 |
0 |
|
| 280 |
0 |
| ST(0) = TARG; |
| 281 |
|
| } |
| 282 |
0 |
| XSRETURN(1); |
| 283 |
0 |
| }); } |
| 284 |
|
| |
| 285 |
|
| |
| 286 |
|
| |
| 287 |
0 |
▶ | XS_EUPXS(XS_MyTest_bench_hints_get) { xs::throw_guard(cv, [=]() |
Branch: 1 branch
| Branch | True | False | Total |
| XS_EUPXS(XS_MyTest_bench_hints_get) { xs::throw_guard(cv, [=]() |
0 |
0 |
0 |
|
| 288 |
|
| { |
| 289 |
0 |
| dVAR; dXSARGS; |
| 290 |
0 |
▶ | if (items != 0) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 0) |
0 |
0 |
0 |
|
| 291 |
0 |
| croak_xs_usage(cv, ""); |
| 292 |
|
| PERL_UNUSED_VAR(ax); /* -Wall */ |
| 293 |
0 |
| SP -= items; |
| 294 |
|
| { |
| 295 |
|
| #line 46 "t/lib/MyTest.xs" |
| 296 |
|
| for (int i = 0; i < 1000; ++i) Scope::Hints::exists(xs::date::strict_hint_name); |
| 297 |
|
| #line 298 "t/lib/MyTest_xsgen.cc" |
| 298 |
0 |
| PUTBACK; |
| 299 |
0 |
| return; |
| 300 |
|
| } |
| 301 |
0 |
| }); } |
| 302 |
|
| |
| 303 |
|
| |
| 304 |
|
| |
| 305 |
0 |
▶ | XS_EUPXS(XS_MyTest_get_strict_hint) { xs::throw_guard(cv, [=]() |
Branch: 1 branch
| Branch | True | False | Total |
| XS_EUPXS(XS_MyTest_get_strict_hint) { xs::throw_guard(cv, [=]() |
0 |
0 |
0 |
|
| 306 |
|
| { |
| 307 |
0 |
| dVAR; dXSARGS; |
| 308 |
0 |
▶ | if (items != 0) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 0) |
0 |
0 |
0 |
|
| 309 |
0 |
| croak_xs_usage(cv, ""); |
| 310 |
|
| { |
| 311 |
|
| bool RETVAL; |
| 312 |
|
| #line 50 "t/lib/MyTest.xs" |
| 313 |
|
| RETVAL = Scope::Hints::exists(xs::date::strict_hint_name); |
| 314 |
|
| #line 315 "t/lib/MyTest_xsgen.cc" |
| 315 |
0 |
▶ | ST(0) = boolSV(RETVAL); |
Branch: 1 branch
| Branch | True | False | Total |
| ST(0) = boolSV(RETVAL); |
0 |
0 |
0 |
|
| 316 |
|
| } |
| 317 |
0 |
| XSRETURN(1); |
| 318 |
0 |
| }); } |
| 319 |
|
| |
| 320 |
|
| #ifdef DATE_TEST_SYS |
| 321 |
|
| #define XSubPPtmpAAAA 1 |
| 322 |
|
| |
| 323 |
|
| |
| 324 |
|
| |
| 325 |
0 |
▶ | XS_EUPXS(XS_MyTest_gmtime_bench) { xs::throw_guard(cv, [=]() |
Branch: 1 branch
| Branch | True | False | Total |
| XS_EUPXS(XS_MyTest_gmtime_bench) { xs::throw_guard(cv, [=]() |
0 |
0 |
0 |
|
| 326 |
|
| { |
| 327 |
0 |
| dVAR; dXSARGS; |
| 328 |
0 |
| dXSI32; |
| 329 |
0 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
0 |
0 |
|
| 330 |
0 |
| croak_xs_usage(cv, "epoch"); |
| 331 |
|
| { |
| 332 |
0 |
| Array RETVAL; |
| 333 |
0 |
▶ | ptime_t epoch = xs::in<ptime_t>(ST(0)); |
Branch: 2 branches
| Branch | True | False | Total |
| ptime_t epoch = xs::in<ptime_t>(ST(0)); |
0 |
0 |
0 |
| ptime_t epoch = xs::in<ptime_t>(ST(0)); |
0 |
0 |
0 |
|
| 334 |
|
| ; |
| 335 |
|
| #line 56 "t/lib/MyTest.xs" |
| 336 |
|
| datetime date; |
| 337 |
|
| ptime_t max_epoch = epoch + 10000; |
| 338 |
|
| if (ix == 0) while(epoch++ < max_epoch) gmtime(epoch, &date); |
| 339 |
|
| else if (ix == 1) while(epoch++ < max_epoch) localtime(epoch, &date); |
| 340 |
|
| |
| 341 |
|
| RETVAL = Array::create(); |
| 342 |
|
| RETVAL.push(Simple(date.sec)); |
| 343 |
|
| RETVAL.push(Simple(date.min)); |
| 344 |
|
| RETVAL.push(Simple(date.hour)); |
| 345 |
|
| RETVAL.push(Simple(date.mday)); |
| 346 |
|
| RETVAL.push(Simple(date.mon)); |
| 347 |
|
| RETVAL.push(Simple(date.year)); |
| 348 |
|
| RETVAL.push(Simple(date.wday)); |
| 349 |
|
| RETVAL.push(Simple(date.yday)); |
| 350 |
|
| RETVAL.push(Simple(date.isdst)); |
| 351 |
|
| RETVAL.push(Simple(date.gmtoff)); |
| 352 |
|
| RETVAL.push(Simple(date.zone)); |
| 353 |
|
| #line 354 "t/lib/MyTest_xsgen.cc" |
| 354 |
|
| { |
| 355 |
|
| SV * RETVALSV; |
| 356 |
0 |
| RETVALSV = NULL; |
| 357 |
0 |
▶ | if (!RETVAL) XSRETURN_UNDEF; |
Branch: 1 branch
| Branch | True | False | Total |
| if (!RETVAL) XSRETURN_UNDEF; |
0 |
0 |
0 |
|
| 358 |
0 |
▶ | RETVALSV = newRV_noinc(RETVAL.detach()); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVALSV = newRV_noinc(RETVAL.detach()); |
0 |
0 |
0 |
|
| 359 |
0 |
▶ | RETVALSV = sv_2mortal(RETVALSV); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVALSV = sv_2mortal(RETVALSV); |
0 |
0 |
0 |
|
| 360 |
0 |
| ST(0) = RETVALSV; |
| 361 |
|
| } |
| 362 |
0 |
▶ | } |
Branch: 1 branch
| Branch | True | False | Total |
| } |
0 |
0 |
0 |
|
| 363 |
0 |
| XSRETURN(1); |
| 364 |
0 |
| }); } |
| 365 |
|
| |
| 366 |
|
| |
| 367 |
|
| |
| 368 |
0 |
▶ | XS_EUPXS(XS_MyTest_posix_gmtime_bench) { xs::throw_guard(cv, [=]() |
Branch: 1 branch
| Branch | True | False | Total |
| XS_EUPXS(XS_MyTest_posix_gmtime_bench) { xs::throw_guard(cv, [=]() |
0 |
0 |
0 |
|
| 369 |
|
| { |
| 370 |
0 |
| dVAR; dXSARGS; |
| 371 |
0 |
| dXSI32; |
| 372 |
0 |
▶ | if (items != 1) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 1) |
0 |
0 |
0 |
|
| 373 |
0 |
| croak_xs_usage(cv, "epoch"); |
| 374 |
|
| { |
| 375 |
0 |
| Array RETVAL; |
| 376 |
0 |
▶ | time_t epoch = (time_t)SvIV(ST(0)) |
Branch: 2 branches
| Branch | True | False | Total |
| time_t epoch = (time_t)SvIV(ST(0)) |
0 |
0 |
0 |
| time_t epoch = (time_t)SvIV(ST(0)) |
0 |
0 |
0 |
|
| 377 |
|
| ; |
| 378 |
|
| #line 76 "t/lib/MyTest.xs" |
| 379 |
|
| struct tm date; |
| 380 |
|
| time_t max_epoch = epoch + 10000; |
| 381 |
|
| if (ix == 0) while(epoch++ < max_epoch) gmtime_r(&epoch, &date); |
| 382 |
|
| else if (ix == 1) while(epoch++ < max_epoch) localtime_r(&epoch, &date); |
| 383 |
|
| |
| 384 |
|
| RETVAL = Array::create(); |
| 385 |
|
| RETVAL.push(Simple(date.tm_sec)); |
| 386 |
|
| RETVAL.push(Simple(date.tm_min)); |
| 387 |
|
| RETVAL.push(Simple(date.tm_hour)); |
| 388 |
|
| RETVAL.push(Simple(date.tm_mday)); |
| 389 |
|
| RETVAL.push(Simple(date.tm_mon)); |
| 390 |
|
| RETVAL.push(Simple(date.tm_year)); |
| 391 |
|
| RETVAL.push(Simple(date.tm_wday)); |
| 392 |
|
| RETVAL.push(Simple(date.tm_yday)); |
| 393 |
|
| RETVAL.push(Simple(date.tm_isdst)); |
| 394 |
|
| RETVAL.push(Simple(date.tm_gmtoff)); |
| 395 |
|
| RETVAL.push(Simple(date.tm_zone)); |
| 396 |
|
| #line 397 "t/lib/MyTest_xsgen.cc" |
| 397 |
|
| { |
| 398 |
|
| SV * RETVALSV; |
| 399 |
0 |
| RETVALSV = NULL; |
| 400 |
0 |
▶ | if (!RETVAL) XSRETURN_UNDEF; |
Branch: 1 branch
| Branch | True | False | Total |
| if (!RETVAL) XSRETURN_UNDEF; |
0 |
0 |
0 |
|
| 401 |
0 |
▶ | RETVALSV = newRV_noinc(RETVAL.detach()); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVALSV = newRV_noinc(RETVAL.detach()); |
0 |
0 |
0 |
|
| 402 |
0 |
▶ | RETVALSV = sv_2mortal(RETVALSV); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVALSV = sv_2mortal(RETVALSV); |
0 |
0 |
0 |
|
| 403 |
0 |
| ST(0) = RETVALSV; |
| 404 |
|
| } |
| 405 |
0 |
▶ | } |
Branch: 1 branch
| Branch | True | False | Total |
| } |
0 |
0 |
0 |
|
| 406 |
0 |
| XSRETURN(1); |
| 407 |
0 |
| }); } |
| 408 |
|
| |
| 409 |
|
| |
| 410 |
|
| |
| 411 |
0 |
▶ | XS_EUPXS(XS_MyTest_timegm_bench) { xs::throw_guard(cv, [=]() |
Branch: 1 branch
| Branch | True | False | Total |
| XS_EUPXS(XS_MyTest_timegm_bench) { xs::throw_guard(cv, [=]() |
0 |
0 |
0 |
|
| 412 |
|
| { |
| 413 |
0 |
| dVAR; dXSARGS; |
| 414 |
0 |
| dXSI32; |
| 415 |
0 |
▶ | if (items != 6) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 6) |
0 |
0 |
0 |
|
| 416 |
0 |
| croak_xs_usage(cv, "sec, min, hour, mday, mon, year"); |
| 417 |
|
| { |
| 418 |
|
| ptime_t RETVAL; |
| 419 |
0 |
▶ | ptime_t sec = xs::in<ptime_t>(ST(0)); |
Branch: 1 branch
| Branch | True | False | Total |
| ptime_t sec = xs::in<ptime_t>(ST(0)); |
0 |
0 |
0 |
|
| 420 |
|
| ; |
| 421 |
0 |
▶ | ptime_t min = xs::in<ptime_t>(ST(1)); |
Branch: 1 branch
| Branch | True | False | Total |
| ptime_t min = xs::in<ptime_t>(ST(1)); |
0 |
0 |
0 |
|
| 422 |
|
| ; |
| 423 |
0 |
▶ | ptime_t hour = xs::in<ptime_t>(ST(2)); |
Branch: 1 branch
| Branch | True | False | Total |
| ptime_t hour = xs::in<ptime_t>(ST(2)); |
0 |
0 |
0 |
|
| 424 |
|
| ; |
| 425 |
0 |
▶ | ptime_t mday = xs::in<ptime_t>(ST(3)); |
Branch: 1 branch
| Branch | True | False | Total |
| ptime_t mday = xs::in<ptime_t>(ST(3)); |
0 |
0 |
0 |
|
| 426 |
|
| ; |
| 427 |
0 |
▶ | ptime_t mon = xs::in<ptime_t>(ST(4)); |
Branch: 1 branch
| Branch | True | False | Total |
| ptime_t mon = xs::in<ptime_t>(ST(4)); |
0 |
0 |
0 |
|
| 428 |
|
| ; |
| 429 |
0 |
▶ | ptime_t year = xs::in<ptime_t>(ST(5)); |
Branch: 1 branch
| Branch | True | False | Total |
| ptime_t year = xs::in<ptime_t>(ST(5)); |
0 |
0 |
0 |
|
| 430 |
|
| ; |
| 431 |
|
| #line 96 "t/lib/MyTest.xs" |
| 432 |
|
| xs::Sv PROTO; PERL_UNUSED_VAR(PROTO); |
| 433 |
|
| datetime date; |
| 434 |
|
| date.sec = sec; |
| 435 |
|
| date.min = min; |
| 436 |
|
| date.hour = hour; |
| 437 |
|
| date.mday = mday; |
| 438 |
|
| date.mon = mon; |
| 439 |
|
| date.year = year; |
| 440 |
|
| date.isdst = -1; |
| 441 |
|
| |
| 442 |
|
| int i = 0; |
| 443 |
|
| int cnt = 10000; |
| 444 |
|
| RETVAL = 0; |
| 445 |
|
| |
| 446 |
|
| if (ix == 0) while (i++ < cnt) RETVAL += timegm(&date); |
| 447 |
|
| else if (ix == 1) while (i++ < cnt) RETVAL += timegml(&date); |
| 448 |
|
| else if (ix == 2) while (i++ < cnt) RETVAL += timelocal(&date); |
| 449 |
|
| else if (ix == 3) while (i++ < cnt) RETVAL += timelocall(&date); |
| 450 |
|
| #line 451 "t/lib/MyTest_xsgen.cc" |
| 451 |
|
| { |
| 452 |
|
| SV * RETVALSV; |
| 453 |
0 |
▶ | RETVALSV = xs::out(RETVAL, PROTO).detach(); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVALSV = xs::out(RETVAL, PROTO).detach(); |
0 |
0 |
0 |
|
| 454 |
0 |
▶ | RETVALSV = sv_2mortal(RETVALSV); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVALSV = sv_2mortal(RETVALSV); |
0 |
0 |
0 |
|
| 455 |
0 |
| ST(0) = RETVALSV; |
| 456 |
|
| } |
| 457 |
0 |
| } |
| 458 |
0 |
| XSRETURN(1); |
| 459 |
0 |
| }); } |
| 460 |
|
| |
| 461 |
|
| |
| 462 |
|
| |
| 463 |
0 |
▶ | XS_EUPXS(XS_MyTest_posix_timegm_bench) { xs::throw_guard(cv, [=]() |
Branch: 1 branch
| Branch | True | False | Total |
| XS_EUPXS(XS_MyTest_posix_timegm_bench) { xs::throw_guard(cv, [=]() |
0 |
0 |
0 |
|
| 464 |
|
| { |
| 465 |
0 |
| dVAR; dXSARGS; |
| 466 |
0 |
| dXSI32; |
| 467 |
0 |
▶ | if (items != 6) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items != 6) |
0 |
0 |
0 |
|
| 468 |
0 |
| croak_xs_usage(cv, "sec, min, hour, mday, mon, year"); |
| 469 |
|
| { |
| 470 |
|
| time_t RETVAL; |
| 471 |
0 |
▶ | dXSTARG; |
Branch: 2 branches
| Branch | True | False | Total |
| dXSTARG; |
0 |
0 |
0 |
| dXSTARG; |
0 |
0 |
0 |
|
| 472 |
0 |
▶ | int64_t sec = (int64_t)SvIV(ST(0)) |
Branch: 1 branch
| Branch | True | False | Total |
| int64_t sec = (int64_t)SvIV(ST(0)) |
0 |
0 |
0 |
|
| 473 |
|
| ; |
| 474 |
0 |
▶ | int64_t min = (int64_t)SvIV(ST(1)) |
Branch: 1 branch
| Branch | True | False | Total |
| int64_t min = (int64_t)SvIV(ST(1)) |
0 |
0 |
0 |
|
| 475 |
|
| ; |
| 476 |
0 |
▶ | int64_t hour = (int64_t)SvIV(ST(2)) |
Branch: 1 branch
| Branch | True | False | Total |
| int64_t hour = (int64_t)SvIV(ST(2)) |
0 |
0 |
0 |
|
| 477 |
|
| ; |
| 478 |
0 |
▶ | int64_t mday = (int64_t)SvIV(ST(3)) |
Branch: 1 branch
| Branch | True | False | Total |
| int64_t mday = (int64_t)SvIV(ST(3)) |
0 |
0 |
0 |
|
| 479 |
|
| ; |
| 480 |
0 |
▶ | int64_t mon = (int64_t)SvIV(ST(4)) |
Branch: 1 branch
| Branch | True | False | Total |
| int64_t mon = (int64_t)SvIV(ST(4)) |
0 |
0 |
0 |
|
| 481 |
|
| ; |
| 482 |
0 |
▶ | int64_t year = (int64_t)SvIV(ST(5)) |
Branch: 2 branches
| Branch | True | False | Total |
| int64_t year = (int64_t)SvIV(ST(5)) |
0 |
0 |
0 |
| int64_t year = (int64_t)SvIV(ST(5)) |
0 |
0 |
0 |
|
| 483 |
|
| ; |
| 484 |
|
| #line 116 "t/lib/MyTest.xs" |
| 485 |
|
| struct tm date; |
| 486 |
|
| date.tm_sec = sec; |
| 487 |
|
| date.tm_min = min; |
| 488 |
|
| date.tm_hour = hour; |
| 489 |
|
| date.tm_mday = mday; |
| 490 |
|
| date.tm_mon = mon; |
| 491 |
|
| date.tm_year = year-1900; |
| 492 |
|
| date.tm_isdst = -1; |
| 493 |
|
| |
| 494 |
|
| int i = 0; |
| 495 |
|
| int cnt = 10000; |
| 496 |
|
| RETVAL = 0; |
| 497 |
|
| |
| 498 |
|
| if (ix == 0) while (i++ < cnt) RETVAL += timegm(&date); |
| 499 |
|
| else if (ix == 1) while (i++ < cnt) RETVAL += timelocal(&date); |
| 500 |
|
| #line 501 "t/lib/MyTest_xsgen.cc" |
| 501 |
0 |
▶ | TARGi((IV)RETVAL, 1); |
Branch: 2 branches
| Branch | True | False | Total |
| TARGi((IV)RETVAL, 1); |
0 |
0 |
0 |
| TARGi((IV)RETVAL, 1); |
0 |
0 |
0 |
|
| 502 |
0 |
| ST(0) = TARG; |
| 503 |
|
| } |
| 504 |
0 |
| XSRETURN(1); |
| 505 |
0 |
| }); } |
| 506 |
|
| |
| 507 |
|
| #endif |
| 508 |
|
| #ifdef __cplusplus |
| 509 |
|
| extern "C" { |
| 510 |
|
| #endif |
| 511 |
|
| |
| 512 |
96 |
▶ | XS_EXTERNAL(boot_MyTest) { xs::throw_guard(cv, [=]() mutable |
Branch: 1 branch
| Branch | True | False | Total |
| XS_EXTERNAL(boot_MyTest) { xs::throw_guard(cv, [=]() mutable |
48 |
0 |
48 |
|
| 513 |
|
| { |
| 514 |
|
| #if PERL_VERSION_LE(5, 21, 5) |
| 515 |
|
| dVAR; dXSARGS; |
| 516 |
|
| #else |
| 517 |
48 |
| dVAR; dXSBOOTARGSXSAPIVERCHK; |
| 518 |
|
| #endif |
| 519 |
|
| #if PERL_VERSION_LE(5, 8, 999) /* PERL_VERSION_LT is 5.33+ */ |
| 520 |
|
| char* file = __FILE__; |
| 521 |
|
| #else |
| 522 |
48 |
| const char* file = __FILE__; |
| 523 |
|
| #endif |
| 524 |
|
| |
| 525 |
|
| PERL_UNUSED_VAR(file); |
| 526 |
|
| |
| 527 |
|
| PERL_UNUSED_VAR(cv); /* -W */ |
| 528 |
|
| PERL_UNUSED_VAR(items); /* -W */ |
| 529 |
|
| #if PERL_VERSION_LE(5, 21, 5) |
| 530 |
|
| XS_VERSION_BOOTCHECK; |
| 531 |
|
| # ifdef XS_APIVERSION_BOOTCHECK |
| 532 |
|
| XS_APIVERSION_BOOTCHECK; |
| 533 |
|
| # endif |
| 534 |
|
| #endif |
| 535 |
|
| |
| 536 |
|
| { |
| 537 |
|
| CV * cv; |
| 538 |
|
| |
| 539 |
48 |
| newXS_deffile("MyTest::bench_parse", XS_MyTest_bench_parse); |
| 540 |
48 |
| newXS_deffile("MyTest::bench_rparse", XS_MyTest_bench_rparse); |
| 541 |
48 |
| newXS_deffile("MyTest::bench_strftime", XS_MyTest_bench_strftime); |
| 542 |
48 |
| newXS_deffile("MyTest::bench_tzget", XS_MyTest_bench_tzget); |
| 543 |
48 |
| newXS_deffile("MyTest::bench_hints_get", XS_MyTest_bench_hints_get); |
| 544 |
48 |
| newXS_deffile("MyTest::get_strict_hint", XS_MyTest_get_strict_hint); |
| 545 |
|
| #if XSubPPtmpAAAA |
| 546 |
48 |
| cv = newXS_deffile("MyTest::gmtime_bench", XS_MyTest_gmtime_bench); |
| 547 |
48 |
| XSANY.any_i32 = 0; |
| 548 |
48 |
| cv = newXS_deffile("MyTest::localtime_bench", XS_MyTest_gmtime_bench); |
| 549 |
48 |
| XSANY.any_i32 = 1; |
| 550 |
48 |
| cv = newXS_deffile("MyTest::posix_gmtime_bench", XS_MyTest_posix_gmtime_bench); |
| 551 |
48 |
| XSANY.any_i32 = 0; |
| 552 |
48 |
| cv = newXS_deffile("MyTest::posix_localtime_bench", XS_MyTest_posix_gmtime_bench); |
| 553 |
48 |
| XSANY.any_i32 = 1; |
| 554 |
48 |
| cv = newXS_deffile("MyTest::timegm_bench", XS_MyTest_timegm_bench); |
| 555 |
48 |
| XSANY.any_i32 = 0; |
| 556 |
48 |
| cv = newXS_deffile("MyTest::timegml_bench", XS_MyTest_timegm_bench); |
| 557 |
48 |
| XSANY.any_i32 = 1; |
| 558 |
48 |
| cv = newXS_deffile("MyTest::timelocal_bench", XS_MyTest_timegm_bench); |
| 559 |
48 |
| XSANY.any_i32 = 2; |
| 560 |
48 |
| cv = newXS_deffile("MyTest::timelocall_bench", XS_MyTest_timegm_bench); |
| 561 |
48 |
| XSANY.any_i32 = 3; |
| 562 |
48 |
| cv = newXS_deffile("MyTest::posix_timegm_bench", XS_MyTest_posix_timegm_bench); |
| 563 |
48 |
| XSANY.any_i32 = 0; |
| 564 |
48 |
| cv = newXS_deffile("MyTest::posix_timelocal_bench", XS_MyTest_posix_timegm_bench); |
| 565 |
48 |
| XSANY.any_i32 = 1; |
| 566 |
|
| #endif |
| 567 |
|
| } |
| 568 |
|
| |
| 569 |
|
| /* Initialisation Section */ |
| 570 |
|
| |
| 571 |
|
| #if XSubPPtmpAAAA |
| 572 |
|
| #endif |
| 573 |
|
| #line 574 "t/lib/MyTest_xsgen.cc" |
| 574 |
|
| |
| 575 |
|
| /* End of Initialisation Section */ |
| 576 |
|
| |
| 577 |
|
| #if PERL_VERSION_LE(5, 21, 5) |
| 578 |
|
| # if PERL_VERSION_GE(5, 9, 0) |
| 579 |
|
| if (PL_unitcheckav) |
| 580 |
|
| call_list(PL_scopestack_ix, PL_unitcheckav); |
| 581 |
|
| # endif |
| 582 |
|
| XSRETURN_YES; |
| 583 |
|
| #else |
| 584 |
48 |
| Perl_xs_boot_epilog(aTHX_ ax); |
| 585 |
|
| #endif |
| 586 |
48 |
| }); } |
| 587 |
|
| |
| 588 |
|
| #ifdef __cplusplus |
| 589 |
|
| } |
| 590 |
|
| #endif |