Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
some more debugging statements
  • Loading branch information
pmurias committed Oct 2, 2011
1 parent ee9b534 commit 9443cf8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/p5embed.c
Expand Up @@ -19,6 +19,7 @@ xs_init(pTHX)
static PerlInterpreter *my_perl;
void p5embed_initialize()
{
printf("# initialising perl\n");
PERL_SYS_INIT3(0,NULL,NULL);
PerlInterpreter* my_perl = perl_alloc();
PERL_SET_CONTEXT(my_perl);
Expand All @@ -27,17 +28,19 @@ void p5embed_initialize()
perl_parse(my_perl, xs_init, 3, embedding, NULL);
PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
eval_pv("use lib 'perl5';use Niecza::Interoperability",TRUE);
printf("# initialised perl\n");
}

SV* p5embed_eval(char* code) {
printf("# evaling code...\n");
printf("# evaling code <%s>...\n",code);
SV* ret = eval_pv(code,TRUE);
printf("# survived evaling code...\n");
return ret;
}

void p5embed_dispose()
{
printf("# disposing of perl\n");
perl_destruct(my_perl);
perl_free(my_perl);
PERL_SYS_TERM();
Expand Down

0 comments on commit 9443cf8

Please sign in to comment.