mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-25 10:09:38 +02:00
perl: make scopes
This commit is contained in:
@@ -31,6 +31,7 @@ typedef struct {
|
|||||||
#define msgpack_unpack_user unpack_user
|
#define msgpack_unpack_user unpack_user
|
||||||
|
|
||||||
void init_Data__MessagePack_unpack(pTHX_ bool const cloning) {
|
void init_Data__MessagePack_unpack(pTHX_ bool const cloning) {
|
||||||
|
// booleans are load on demand (lazy load).
|
||||||
if(!cloning) {
|
if(!cloning) {
|
||||||
MY_CXT_INIT;
|
MY_CXT_INIT;
|
||||||
MY_CXT.msgpack_true = NULL;
|
MY_CXT.msgpack_true = NULL;
|
||||||
@@ -52,11 +53,17 @@ static SV*
|
|||||||
load_bool(pTHX_ const char* const name) {
|
load_bool(pTHX_ const char* const name) {
|
||||||
CV* const cv = get_cv(name, GV_ADD);
|
CV* const cv = get_cv(name, GV_ADD);
|
||||||
dSP;
|
dSP;
|
||||||
|
ENTER;
|
||||||
|
SAVETMPS;
|
||||||
PUSHMARK(SP);
|
PUSHMARK(SP);
|
||||||
call_sv((SV*)cv, G_SCALAR);
|
call_sv((SV*)cv, G_SCALAR);
|
||||||
SPAGAIN;
|
SPAGAIN;
|
||||||
SV* const sv = newSVsv(POPs);
|
SV* const sv = newSVsv(POPs);
|
||||||
PUTBACK;
|
PUTBACK;
|
||||||
|
FREETMPS;
|
||||||
|
LEAVE;
|
||||||
|
assert(sv);
|
||||||
|
assert(sv_isobject(sv));
|
||||||
return sv;
|
return sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user