From: Mark-Jason Dominus Date: Sun, 22 Apr 2001 15:12:57 +0000 (-0400) Subject: PATCH 5.7.1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=85bbbcc457b8c77e8df2a0ac2846394135a59c3a;p=p5sagit%2Fp5-mst-13.2.git PATCH 5.7.1 Message-ID: <20010422191258.6539.qmail@plover.com> plus Sarathy's STMT_START + STMT_END suggestion. p4raw-id: //depot/perl@9787 --- diff --git a/perl.h b/perl.h index ab7a8e8..edb14e5 100644 --- a/perl.h +++ b/perl.h @@ -3483,17 +3483,23 @@ 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 { \ +#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; \ - } while (0) + } STMT_END #ifdef HAS_SEM # include