diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-06-01 20:46:02 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-06-01 20:46:02 +0000 |
commit | e5fc398ae0b5fa5d4f2b3f5d35e964bf6aadd1b6 (patch) | |
tree | 09a500b0d6951b724685d60716d06c2d8ac13770 /perl.h | |
parent | 1019c5e2e77274f1569b932c7015971b13542ed3 (diff) | |
download | perl-e5fc398ae0b5fa5d4f2b3f5d35e964bf6aadd1b6.tar.gz |
Round up all string length requests to malloc()/realloc() to the next
multiple of 4/8 bytes [sizeof(size_t)] on the assumption that malloc()
internally will quantise, and so we're going to use space that
otherwise would be wasted. Hopefully this will save realloc()ing.
p4raw-id: //depot/perl@24665
Diffstat (limited to 'perl.h')
-rw-r--r-- | perl.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -803,6 +803,13 @@ int usleep(unsigned int); #define MEM_SIZE Size_t +/* Round all values passed to malloc up, by default to a multiple of + sizeof(size_t) +*/ +#ifndef PERL_STRLEN_ROUNDUP_QUANTUM +#define PERL_STRLEN_ROUNDUP_QUANTUM Size_t_size +#endif + #if defined(STANDARD_C) && defined(I_STDDEF) # include <stddef.h> # define STRUCT_OFFSET(s,m) offsetof(s,m) |