summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorMark-Jason Dominus <mjd@plover.com>2001-04-23 06:30:21 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2001-04-23 13:39:13 +0000
commit30ad99e7b3f61a34d0ea0f6fdc5b568bb12f039e (patch)
tree058ce062c0b4029a0332f260edc64cfc6236ce12 /perl.h
parent2787609acf15f48228c13df6c63c83544ebda559 (diff)
downloadperl-30ad99e7b3f61a34d0ea0f6fdc5b568bb12f039e.tar.gz
Re: PATCH 5.7.1
Message-ID: <20010423143021.17335.qmail@plover.com> p4raw-id: //depot/perl@9792
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h32
1 files changed, 15 insertions, 17 deletions
diff --git a/perl.h b/perl.h
index edb14e57c3..01a6d3fcb9 100644
--- a/perl.h
+++ b/perl.h
@@ -3483,23 +3483,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 <sys/ipc.h>