diff options
author | Nicholas Clark <nick@ccl4.org> | 2004-07-16 11:04:37 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2004-07-16 11:04:37 +0000 |
commit | e90e236463307bd7f53439b91573fe42e9cb8901 (patch) | |
tree | 89bf49d9ec83486ed0205849ff8ae782b1c2947e /malloc.c | |
parent | b0bc38e63ed7e7e448fb07e45ee093d3b3d54be8 (diff) | |
download | perl-e90e236463307bd7f53439b91573fe42e9cb8901.tar.gz |
Encourage compilers to tail call optimise in sv_savepv, sv_savepvn
and sv_savesharedpv. Need to create non-void returning versions of
Copy and Zero, as the existing macros deliberately cast to (void)
p4raw-id: //depot/perl@23126
Diffstat (limited to 'malloc.c')
-rw-r--r-- | malloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -357,6 +357,7 @@ # define Free_t void # endif # define Copy(s,d,n,t) (void)memcpy((char*)(d),(char*)(s), (n) * sizeof(t)) +# define CopyD(s,d,n,t) memcpy((char*)(d),(char*)(s), (n) * sizeof(t)) # define PerlEnv_getenv getenv # define PerlIO_printf fprintf # define PerlIO_stderr() stderr @@ -2311,8 +2312,7 @@ Perl_strdup(const char *s) MEM_SIZE l = strlen(s); char *s1 = (char *)Perl_malloc(l+1); - Copy(s, s1, (MEM_SIZE)(l+1), char); - return s1; + return CopyD(s, s1, (MEM_SIZE)(l+1), char); } #ifdef PERL_CORE |