line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#define PERL_NO_GET_CONTEXT |
2
|
|
|
|
|
|
|
#include "EXTERN.h" |
3
|
|
|
|
|
|
|
#include "perl.h" |
4
|
|
|
|
|
|
|
#include "XSUB.h" |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
#ifndef SAVEDESTRUCTOR_X |
7
|
|
|
|
|
|
|
#define SAVEDESTRUCTOR_X SAVEDESTRUCTOR |
8
|
|
|
|
|
|
|
static void scope_exit(void* block) { |
9
|
|
|
|
|
|
|
dTHX; |
10
|
|
|
|
|
|
|
#else |
11
|
3
|
|
|
|
|
|
static void scope_exit(pTHX_ void* block) { |
12
|
|
|
|
|
|
|
#endif |
13
|
3
|
|
|
|
|
|
dSP; |
14
|
3
|
50
|
|
|
|
|
PUSHMARK(SP); |
15
|
3
|
|
|
|
|
|
call_sv(block, G_VOID | G_DISCARD | G_NOARGS | G_EVAL | G_KEEPERR); |
16
|
|
|
|
|
|
|
SvREFCNT_dec(block); |
17
|
3
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
MODULE = Scope::OnExit PACKAGE = Scope::OnExit |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
void |
22
|
|
|
|
|
|
|
on_scope_exit(block) |
23
|
|
|
|
|
|
|
CV* block; |
24
|
|
|
|
|
|
|
PROTOTYPE: & |
25
|
|
|
|
|
|
|
CODE: |
26
|
3
|
|
|
|
|
|
LEAVE; |
27
|
|
|
|
|
|
|
SvREFCNT_inc(block); |
28
|
3
|
|
|
|
|
|
SAVEDESTRUCTOR_X(scope_exit, block); |
29
|
3
|
|
|
|
|
|
ENTER; |