X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl.c;h=25cdcd6e4ba3f3cb3fa02b777ac28987d22a8424;hb=83ea2aad1336e3391e134c006ffdacaf0b5bd14a;hp=cef5c4783a796a8a5471a84ea1e342a47ddcf96d;hpb=50dd6e574ff39b609595ddb16b2fe9f625a26f8c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/perl.c b/perl.c index cef5c47..25cdcd6 100644 --- a/perl.c +++ b/perl.c @@ -59,12 +59,9 @@ static I32 read_e_script(pTHXo_ int idx, SV *buf_sv, int maxlen); #else # if defined(USE_ITHREADS) -static void S_atfork_lock(void); -static void S_atfork_unlock(void); - /* this is called in parent before the fork() */ -static void -S_atfork_lock(void) +void +Perl_atfork_lock(void) { /* locks must be held in locking order (if any) */ #ifdef MYMALLOC @@ -74,8 +71,8 @@ S_atfork_lock(void) } /* this is called in both parent and child after the fork() */ -static void -S_atfork_unlock(void) +void +Perl_atfork_unlock(void) { /* locks must be released in same order as in S_atfork_lock() */ #ifdef MYMALLOC @@ -92,9 +89,6 @@ S_atfork_unlock(void) ALLOC_THREAD_KEY; \ PERL_SET_THX(my_perl); \ OP_REFCNT_INIT; \ - PTHREAD_ATFORK(S_atfork_lock, \ - S_atfork_unlock, \ - S_atfork_unlock); \ } \ else { \ PERL_SET_THX(my_perl); \ @@ -312,7 +306,13 @@ perl_construct(pTHXx) PL_fdpid = newAV(); /* for remembering popen pids by fd */ PL_modglobal = newHV(); /* pointers to per-interpreter module globals */ PL_errors = newSVpvn("",0); - +#ifdef USE_ITHREADS + PL_regex_padav = newAV(); +#endif +#ifdef USE_REENTRANT_API + New(31337, PL_reentrant_buffer,1, REBUF); + New(31337, PL_reentrant_buffer->tmbuff,1, struct tm); +#endif ENTER; } @@ -805,6 +805,11 @@ perl_destruct(pTHXx) PL_thrsv = Nullsv; #endif /* USE_THREADS */ +#ifdef USE_REENTRANT_API + Safefree(PL_reentrant_buffer->tmbuff); + Safefree(PL_reentrant_buffer); +#endif + sv_free_arenas(); /* As the absolutely last thing, free the non-arena SV for mess() */