diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-03-10 04:57:07 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-03-10 04:57:07 +0000 |
commit | 59bd0823b6625605b67ec19bd9bcc4dd06530e7e (patch) | |
tree | c458c6636e5d8beb343d9a9b8fdec8f949f42584 | |
parent | cb8129f94a333dfcf2cb8cf5b66784f951fc14de (diff) | |
download | perl-59bd0823b6625605b67ec19bd9bcc4dd06530e7e.tar.gz |
Renaming tweaks, and split off the reentrant "superbuffer"
init routine.
p4raw-id: //depot/perl@15139
-rw-r--r-- | embed.fnc | 3 | ||||
-rw-r--r-- | embed.h | 6 | ||||
-rw-r--r-- | global.sym | 1 | ||||
-rw-r--r-- | intrpvar.h | 2 | ||||
-rw-r--r-- | op.h | 12 | ||||
-rw-r--r-- | perl.c | 5 | ||||
-rw-r--r-- | proto.h | 3 | ||||
-rw-r--r-- | sv.c | 3 | ||||
-rw-r--r-- | util.c | 9 |
9 files changed, 32 insertions, 12 deletions
@@ -554,6 +554,9 @@ dopM |PerlIO*|start_glob |SV* pattern|IO *io #if defined(USE_5005THREADS) Ap |struct perl_thread* |new_struct_thread|struct perl_thread *t #endif +#if defined(USE_REENTRANT_API) +Ap |void |reentrant_init +#endif Ap |void |call_atexit |ATEXIT_t fn|void *ptr Apd |I32 |call_argv |const char* sub_name|I32 flags|char** argv Apd |I32 |call_method |const char* methname|I32 flags @@ -533,6 +533,9 @@ #if defined(USE_5005THREADS) #define new_struct_thread Perl_new_struct_thread #endif +#if defined(USE_REENTRANT_API) +#define reentrant_init Perl_reentrant_init +#endif #define call_atexit Perl_call_atexit #define call_argv Perl_call_argv #define call_method Perl_call_method @@ -2089,6 +2092,9 @@ #if defined(USE_5005THREADS) #define new_struct_thread(a) Perl_new_struct_thread(aTHX_ a) #endif +#if defined(USE_REENTRANT_API) +#define reentrant_init() Perl_reentrant_init(aTHX) +#endif #define call_atexit(a,b) Perl_call_atexit(aTHX_ a,b) #define call_argv(a,b,c) Perl_call_argv(aTHX_ a,b,c) #define call_method(a,b) Perl_call_method(aTHX_ a,b) diff --git a/global.sym b/global.sym index 9b709ec181..760606c0ae 100644 --- a/global.sym +++ b/global.sym @@ -321,6 +321,7 @@ Perl_ninstr Perl_op_free Perl_pad_sv Perl_new_struct_thread +Perl_reentrant_init Perl_call_atexit Perl_call_argv Perl_call_method diff --git a/intrpvar.h b/intrpvar.h index dccbdb65b6..f113def0fe 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -487,7 +487,7 @@ PERLVAR(Iregex_pad, SV**) /* All regex objects */ PERLVAR(Iregex_padav, AV*) /* All regex objects */ #ifdef USE_REENTRANT_API -PERLVAR(Ireentrant_buffer, REBUF*) /* here we store the _r buffers */ +PERLVAR(Ireentrant_buffer, REENTBUF*) /* here we store the _r buffers */ #endif #endif @@ -479,11 +479,11 @@ struct loop { #ifdef USE_REENTRANT_API typedef struct { - struct tm* tmbuff; -} REBUF; + struct tm* tmbuf; +} REENTBUF; -#define localtime(a) (localtime_r((a),PL_reentrant_buffer->tmbuff) ? PL_reentrant_buffer->tmbuff : NULL) -#define gmtime(a) (gmtime_r((a),PL_reentrant_buffer->tmbuff) ? PL_reentrant_buffer->tmbuff : NULL) +#define localtime(a) (localtime_r((a),PL_reentrant_buffer->tmbuf) ? PL_reentrant_buffer->tmbuf : NULL) +#define gmtime(a) (gmtime_r((a),PL_reentrant_buffer->tmbuf) ? PL_reentrant_buffer->tmbuf : NULL) #ifdef OLD_PTHREADS_API @@ -493,8 +493,8 @@ typedef struct { #undef localtime #undef gmtime -#define localtime(a) ((localtime_r((a),PL_reentrant_buffer->tmbuff) == 0) ? PL_reentrant_buffer->tmbuff : NULL) -#define gmtime(a) ((gmtime_r((a),PL_reentrant_buffer->tmbuff) == 0) ? PL_reentrant_buffer->tmbuff : NULL) +#define localtime(a) ((localtime_r((a),PL_reentrant_buffer->tmbuf) == 0) ? PL_reentrant_buffer->tmbuf : NULL) +#define gmtime(a) ((gmtime_r((a),PL_reentrant_buffer->tmbuf) == 0) ? PL_reentrant_buffer->tmbuf : NULL) #endif /* HP-UX 10.20 */ #endif @@ -264,8 +264,7 @@ perl_construct(pTHXx) PL_regex_pad = AvARRAY(PL_regex_padav); #endif #ifdef USE_REENTRANT_API - New(31337, PL_reentrant_buffer,1, REBUF); - New(31337, PL_reentrant_buffer->tmbuff,1, struct tm); + Perl_reentrant_init(aTHX); #endif /* Note that strtab is a rather special HV. Assumptions are made @@ -836,7 +835,7 @@ perl_destruct(pTHXx) #endif /* USE_5005THREADS */ #ifdef USE_REENTRANT_API - Safefree(PL_reentrant_buffer->tmbuff); + Safefree(PL_reentrant_buffer->tmbuf); Safefree(PL_reentrant_buffer); #endif @@ -595,6 +595,9 @@ PERL_CALLCONV PerlIO* Perl_start_glob(pTHX_ SV* pattern, IO *io); #if defined(USE_5005THREADS) PERL_CALLCONV struct perl_thread* Perl_new_struct_thread(pTHX_ struct perl_thread *t); #endif +#if defined(USE_REENTRANT_API) +PERL_CALLCONV void Perl_reentrant_init(pTHX); +#endif PERL_CALLCONV void Perl_call_atexit(pTHX_ ATEXIT_t fn, void *ptr); PERL_CALLCONV I32 Perl_call_argv(pTHX_ const char* sub_name, I32 flags, char** argv); PERL_CALLCONV I32 Perl_call_method(pTHX_ const char* methname, I32 flags); @@ -9867,8 +9867,7 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags, PL_debug = proto_perl->Idebug; #ifdef USE_REENTRANT_API - New(31337, PL_reentrant_buffer,1, REBUF); - New(31337, PL_reentrant_buffer->tmbuff,1, struct tm); + Perl_reentrant_init(aTHX); #endif /* create SV map for pointer relocation */ @@ -4348,5 +4348,14 @@ Perl_sv_nounlocking(pTHX_ SV *sv) { } +void +Perl_reentrant_init(pTHX) +{ +#ifdef USE_REENTRANT_API + New(31337, PL_reentrant_buffer, 1, REENTBUF); + New(31337, PL_reentrant_buffer->tmbuf, 1, struct tm); +#endif +} + |