Ap |GV* |gv_SVadd |NN GV* gv
#endif
+p |void |offer_nice_chunk |NN void *chunk|U32 chunk_size
+
END_EXTERN_C
/*
* ex: set ts=8 sts=4 sw=4 noet:
#ifdef PERL_DONT_CREATE_GVSV
#define gv_SVadd Perl_gv_SVadd
#endif
+#ifdef PERL_CORE
+#define offer_nice_chunk Perl_offer_nice_chunk
+#endif
#define ck_anoncode Perl_ck_anoncode
#define ck_bitop Perl_ck_bitop
#define ck_concat Perl_ck_concat
#ifdef PERL_DONT_CREATE_GVSV
#define gv_SVadd(a) Perl_gv_SVadd(aTHX_ a)
#endif
+#ifdef PERL_CORE
+#define offer_nice_chunk(a,b) Perl_offer_nice_chunk(aTHX_ a,b)
+#endif
#define ck_anoncode(a) Perl_ck_anoncode(aTHX_ a)
#define ck_bitop(a) Perl_ck_bitop(aTHX_ a)
#define ck_concat(a) Perl_ck_concat(aTHX_ a)
#define PERL_ALLOC_CHECK(p) NOOP
#endif
-/*
- * 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 { \
- 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) { \
- Safefree(PL_nice_chunk); \
- PL_nice_chunk = (char *) new_chunk; \
- PL_nice_chunk_size = new_chunk_size; \
- } else { \
- Safefree(chunk); \
- } \
- UNLOCK_SV_MUTEX; \
- } STMT_END
-
#ifdef HAS_SEM
# include <sys/ipc.h>
# include <sys/sem.h>
#endif
+PERL_CALLCONV void Perl_offer_nice_chunk(pTHX_ void *chunk, U32 chunk_size)
+ __attribute__nonnull__(pTHX_1);
+
+
END_EXTERN_C
/*
* ex: set ts=8 sts=4 sw=4 noet:
* "A time to plant, and a time to uproot what was planted..."
*/
+/*
+ * nice_chunk and nice_chunk size need to be set
+ * and queried under the protection of sv_mutex
+ */
+void
+Perl_offer_nice_chunk(pTHX_ void *chunk, U32 chunk_size)
+{
+ 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) {
+ Safefree(PL_nice_chunk);
+ PL_nice_chunk = (char *) new_chunk;
+ PL_nice_chunk_size = new_chunk_size;
+ } else {
+ Safefree(chunk);
+ }
+ UNLOCK_SV_MUTEX;
+}
#ifdef DEBUG_LEAKING_SCALARS
# ifdef NETWARE