X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl.h;h=8d9263d90ac8a41cf6aa1eaab31df8518a582930;hb=6ec152c37130b7e4730fc56d5699a4b02f7c0f4a;hp=ab7a8e8f4853e019db60ce9b845d81a14295d017;hpb=4e0554ec1a41c5b5d840b8e29e149a0efe77a52c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/perl.h b/perl.h index ab7a8e8..8d9263d 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 @@ -3334,7 +3336,7 @@ typedef struct am_table_short AMTS; #define IS_NUMERIC_RADIX(s) \ ((PL_hints & HINT_LOCALE) && \ - PL_numeric_radix && memEQ(s, SvPVX(PL_numeric_radix), SvCUR(PL_numeric_radix))) + PL_numeric_radix_sv && memEQ(s, SvPVX(PL_numeric_radix_sv), SvCUR(PL_numeric_radix_sv))) #define STORE_NUMERIC_LOCAL_SET_STANDARD() \ bool was_local = (PL_hints & HINT_LOCALE) && PL_numeric_local; \ @@ -3483,17 +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) do { \ - LOCK_SV_MUTEX; \ - if (!PL_nice_chunk) { \ - PL_nice_chunk = (char*)(chunk); \ - PL_nice_chunk_size = (chunk_size); \ - } \ - else { \ - Safefree(chunk); \ - } \ - UNLOCK_SV_MUTEX; \ - } while (0) +#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