From: Nicholas Clark Date: Sat, 4 Feb 2006 13:27:00 +0000 (+0000) Subject: Rejig the definition of ARENAS_PER_SET to maximise the size of the X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e61480391891581f5adefefc4f92d1d919170395;p=p5sagit%2Fp5-mst-13.2.git Rejig the definition of ARENAS_PER_SET to maximise the size of the array whilst keeping the structure within PERL_ARENA_SIZE. p4raw-id: //depot/perl@27081 --- diff --git a/sv.c b/sv.c index 2c9a593..babfe9d 100644 --- a/sv.c +++ b/sv.c @@ -584,7 +584,14 @@ struct arena_desc { */ }; -#define ARENAS_PER_SET 256+64 /* x 3words/arena_desc -> ~ 4kb/arena_set */ +struct arena_set; + +/* Get the maximum number of elements in set[] such that struct arena_set + will fit within PERL_ARENA_SIZE, which is probabably just under 4K, and + therefore likely to be 1 aligned memory page. */ + +#define ARENAS_PER_SET ((PERL_ARENA_SIZE - sizeof(struct arena_set*) \ + - 2 * sizeof(int)) / sizeof (struct arena_desc)) struct arena_set { struct arena_set* next;