X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl.h;h=57afb3e37cf02f30d9f68c25c318844aa045db3f;hb=35dcc76e92e9d0d2ee72780d700d8645acd7cae8;hp=edb14e57c3801a9d01e7e2d8d058efe97f7c073d;hpb=85bbbcc457b8c77e8df2a0ac2846394135a59c3a;p=p5sagit%2Fp5-mst-13.2.git diff --git a/perl.h b/perl.h index edb14e5..57afb3e 100644 --- a/perl.h +++ b/perl.h @@ -1842,10 +1842,12 @@ typedef pthread_key_t perl_key; #endif /* This defines a way to flush all output buffers. This may be a - * performance issue, so we allow people to disable it. + * performance issue, so we allow people to disable it. Also, if + * we are using stdio, there are broken implementations of fflush(NULL) + * out there, Solaris being the most prominent. */ #ifndef PERL_FLUSHALL_FOR_CHILD -# if defined(FFLUSH_NULL) || defined(USE_SFIO) +# if defined(USE_PERLIO) || defined(FFLUSH_NULL) || defined(USE_SFIO) # define PERL_FLUSHALL_FOR_CHILD PerlIO_flush((PerlIO*)NULL) # else # ifdef FFLUSH_ALL @@ -3483,23 +3485,21 @@ typedef struct am_table_short AMTS; * nice_chunk and nice_chunk size need to be set * and queried under the protection of sv_mutex */ -#define offer_nice_chunk(chunk, chunk_size) \ - STMT_START { \ - LOCK_SV_MUTEX; \ - if (!PL_nice_chunk) { \ - PL_nice_chunk = (char*)(chunk); \ - PL_nice_chunk_size = (chunk_size); \ - } \ - else if (chunk_size > PL_nice_chunk_size) { \ - Safefree(PL_nice_chunk); \ - PL_nice_chunk = (char*)(chunk); \ - PL_nice_chunk_size = (chunk_size); \ - } \ - else { \ - Safefree(chunk); \ - } \ - UNLOCK_SV_MUTEX; \ - } STMT_END +#define offer_nice_chunk(chunk, chunk_size) STMT_START { \ + void *new_chunk; \ + U32 new_chunk_size; \ + LOCK_SV_MUTEX; \ + new_chunk = (void *)(chunk); \ + new_chunk_size = (chunk_size); \ + if (new_chunk_size > PL_nice_chunk_size) { \ + if (PL_nice_chunk) Safefree(PL_nice_chunk); \ + PL_nice_chunk = new_chunk; \ + PL_nice_chunk_size = new_chunk_size; \ + } else { \ + Safefree(chunk); \ + } \ + UNLOCK_SV_MUTEX; \ + } STMT_END #ifdef HAS_SEM # include