X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=sv.c;h=c93c0ea32ad0a1dfc579b137762fa59065267ff4;hb=0f2f9b7d11418e87db6be7dcc244e0da7e2bacec;hp=c31ada73e91d3d024be88307fd4d8a62c4cef44f;hpb=4be49ee61a2cd6ec9ba90ecf286cbb4ee1cf7e96;p=p5sagit%2Fp5-mst-13.2.git diff --git a/sv.c b/sv.c index c31ada7..c93c0ea 100644 --- a/sv.c +++ b/sv.c @@ -5309,6 +5309,7 @@ Perl_sv_replace(pTHX_ register SV *sv, register SV *nsv) #endif SvREFCNT(sv) = refcnt; SvFLAGS(nsv) |= SVTYPEMASK; /* Mark as freed */ + SvREFCNT(nsv) = 0; del_SV(nsv); } @@ -6622,15 +6623,23 @@ thats_really_all_folks: } else { -#ifndef EPOC - /*The big, slow, and stupid way */ - STDCHAR buf[8192]; + /*The big, slow, and stupid way. */ + + /* Any stack-challenged places. */ +#if defined(EPOC) + /* EPOC: need to work around SDK features. * + * On WINS: MS VC5 generates calls to _chkstk, * + * if a "large" stack frame is allocated. * + * gcc on MARM does not generate calls like these. */ +# define USEHEAPINSTEADOFSTACK +#endif + +#ifdef USEHEAPINSTEADOFSTACK + STDCHAR *buf = 0; + New(0, buf, 8192, STDCHAR); + assert(buf); #else - /* Need to work around EPOC SDK features */ - /* On WINS: MS VC5 generates calls to _chkstk, */ - /* if a `large' stack frame is allocated */ - /* gcc on MARM does not generate calls like these */ - STDCHAR buf[1024]; + STDCHAR buf[8192]; #endif screamer2: @@ -6679,6 +6688,10 @@ screamer2: if (!(cnt < sizeof(buf) && PerlIO_eof(fp))) goto screamer2; } + +#ifdef USEHEAPINSTEADOFSTACK + Safefree(buf); +#endif } if (rspara) { /* have to do this both before and after */ @@ -7366,6 +7379,7 @@ Perl_sv_reset(pTHX_ register char *s, HV *stash) } if (GvHV(gv) && !HvNAME(GvHV(gv))) { hv_clear(GvHV(gv)); +#ifndef PERL_MICRO #ifdef USE_ENVIRON_ARRAY if (gv == PL_envgv # ifdef USE_ITHREADS @@ -7376,6 +7390,7 @@ Perl_sv_reset(pTHX_ register char *s, HV *stash) environ[0] = Nullch; } #endif +#endif /* !PERL_MICRO */ } } }