ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro/State.xs
(Generate patch)

Comparing Coro/Coro/State.xs (file contents):
Revision 1.13 by root, Mon Jul 23 22:09:39 2001 UTC vs.
Revision 1.14 by root, Mon Jul 23 23:48:05 2001 UTC

8# include <unistd.h> 8# include <unistd.h>
9# include <sys/mman.h> 9# include <sys/mman.h>
10#endif 10#endif
11 11
12#define MAY_FLUSH /* increases codesize */ 12#define MAY_FLUSH /* increases codesize */
13
14#define SUB_INIT "Coro::State::initialize"
15 13
16#define TRANSFER_SAVE_DEFAV 0x00000001 14#define TRANSFER_SAVE_DEFAV 0x00000001
17#define TRANSFER_SAVE_DEFSV 0x00000002 15#define TRANSFER_SAVE_DEFSV 0x00000002
18#define TRANSFER_SAVE_ERRSV 0x00000004 16#define TRANSFER_SAVE_ERRSV 0x00000004
19#define TRANSFER_SAVE_CCTXT 0x00000008 17#define TRANSFER_SAVE_CCTXT 0x00000008
20 18
21#define TRANSFER_SAVE_ALL -1 19#define TRANSFER_SAVE_ALL -1
20
21#define SUB_INIT "Coro::State::initialize"
22#define UCORO_STATE "_coro_state"
22 23
23struct coro { 24struct coro {
24 /* the optional C context */ 25 /* the optional C context */
25 coro_context cctx; 26 coro_context cctx;
26 void *sptr; 27 void *sptr;
70typedef struct coro *Coro__State; 71typedef struct coro *Coro__State;
71typedef struct coro *Coro__State_or_hashref; 72typedef struct coro *Coro__State_or_hashref;
72 73
73static AV *main_mainstack; /* used to differentiate between $main and others */ 74static AV *main_mainstack; /* used to differentiate between $main and others */
74static HV *coro_state_stash; 75static HV *coro_state_stash;
76static SV *ucoro_state_sv;
77static U32 ucoro_state_hash;
75static HV *padlist_cache; 78static HV *padlist_cache;
76 79
77/* mostly copied from op.c:cv_clone2 */ 80/* mostly copied from op.c:cv_clone2 */
78STATIC AV * 81STATIC AV *
79clone_padlist (AV *protopadlist) 82clone_padlist (AV *protopadlist)
646 649
647PROTOTYPES: ENABLE 650PROTOTYPES: ENABLE
648 651
649BOOT: 652BOOT:
650{ /* {} necessary for stoopid perl-5.6.x */ 653{ /* {} necessary for stoopid perl-5.6.x */
654 ucoro_state_sv = newSVpv (UCORO_STATE, sizeof(UCORO_STATE) - 1);
655 PERL_HASH(ucoro_state_hash, UCORO_STATE, sizeof(UCORO_STATE) - 1);
651 coro_state_stash = gv_stashpvn ("Coro::State", 10, TRUE); 656 coro_state_stash = gv_stashpv ("Coro::State", TRUE);
652 657
653 newCONSTSUB (coro_state_stash, "SAVE_DEFAV", newSViv (TRANSFER_SAVE_DEFAV)); 658 newCONSTSUB (coro_state_stash, "SAVE_DEFAV", newSViv (TRANSFER_SAVE_DEFAV));
654 newCONSTSUB (coro_state_stash, "SAVE_DEFSV", newSViv (TRANSFER_SAVE_DEFSV)); 659 newCONSTSUB (coro_state_stash, "SAVE_DEFSV", newSViv (TRANSFER_SAVE_DEFSV));
655 newCONSTSUB (coro_state_stash, "SAVE_ERRSV", newSViv (TRANSFER_SAVE_ERRSV)); 660 newCONSTSUB (coro_state_stash, "SAVE_ERRSV", newSViv (TRANSFER_SAVE_ERRSV));
656 newCONSTSUB (coro_state_stash, "SAVE_CCTXT", newSViv (TRANSFER_SAVE_CCTXT)); 661 newCONSTSUB (coro_state_stash, "SAVE_CCTXT", newSViv (TRANSFER_SAVE_CCTXT));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines