summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-02-27 19:11:12 +0000
committerNicholas Clark <nick@ccl4.org>2008-02-27 19:11:12 +0000
commitd8fca4022b56f335fb492e336b5d155376eb1bf7 (patch)
tree5782cd9ec92f2203934b6f0f38f71916e4e1e90d /perl.h
parent641071807211a3969bcad26ac3f2a39f4550a11c (diff)
downloadperl-d8fca4022b56f335fb492e336b5d155376eb1bf7.tar.gz
Use malloc_good_size() to round up the size of requested arenas to the
size that will actually be allocated, to squeeze last few bytes into use. p4raw-id: //depot/perl@33390
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/perl.h b/perl.h
index 736d365c21..65b3a722bc 100644
--- a/perl.h
+++ b/perl.h
@@ -4059,6 +4059,8 @@ struct perl_memory_debug_header {
(MEM_ALIGNBYTES - sizeof(struct perl_memory_debug_header) \
%MEM_ALIGNBYTES) % MEM_ALIGNBYTES)
+#else
+# define sTHX 0
#endif
#ifdef PERL_TRACK_MEMPOOL
@@ -4078,6 +4080,13 @@ struct perl_memory_debug_header {
# define Perl_safesysmalloc_size(where) \
(malloc_size(((char *)(where)) - sTHX) - sTHX)
# endif
+# ifdef HAS_MALLOC_GOOD_SIZE
+# define Perl_malloc_good_size(how_much) \
+ (malloc_good_size((how_much) + sTHX) - sTHX)
+# else
+/* Having this as the identity operation makes some code simpler. */
+# define Perl_malloc_good_size(how_much) (how_much)
+# endif
#endif
typedef int (CPERLscope(*runops_proc_t)) (pTHX);