diff options
author | Mark-Jason Dominus <mjd@plover.com> | 2001-04-22 11:12:57 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-04-23 13:02:02 +0000 |
commit | 85bbbcc457b8c77e8df2a0ac2846394135a59c3a (patch) | |
tree | f4501e22f4c8a9653bc83c150e1888326adbc12f /perl.h | |
parent | 679ac26e110ef97fbf30ce13479d7051699b4a34 (diff) | |
download | perl-85bbbcc457b8c77e8df2a0ac2846394135a59c3a.tar.gz |
PATCH 5.7.1
Message-ID: <20010422191258.6539.qmail@plover.com>
plus Sarathy's STMT_START + STMT_END suggestion.
p4raw-id: //depot/perl@9787
Diffstat (limited to 'perl.h')
-rw-r--r-- | perl.h | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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 <sys/ipc.h> |