2014-12-04
2014-12-04 19:26:26 by Per Hedbor <ph@opera.com>
-
e16159c2acf1a1db5f84691e55a5448eadde3019
(17 lines)
(+9/-8)
[
Show
| Annotate
]
Branch: bill/master_archive_support
Binary size: push_constant_text -> push_text when not time-critical.
Especially in error handling, and code that does a lot of other string
operations anyway the speed gain is not wort the 100+ bytes code size
of each instance of push_constant_text
This saves about 20K of code size (main pike binary), while not really
changing the speed much.
push_constant_text that seemed to be in at least pseudo-time-critical
code was kept as they were.
On a related note, push_constant_text(":") four times in a row creates
four different string variables, for obvious reasons.
Some of the remaining push_constant_text really should have a
module/file local string variable, even though that is more bothersome
to create.
It might be nice to have this in .cmod files automatically.
2465: Inside #if defined(HAVE_GRANTPT) || defined(USE_PT_CHMOD) || defined(USE_CHGPT)
{
pop_n_elems(args);
#if defined(USE_PT_CHMOD) || defined(USE_CHGPT)
- push_constant_text("Process.Process");
+ push_text("Process.Process");
APPLY_MASTER("resolv", 1);
#ifdef USE_PT_CHMOD
/* pt_chmod wants to get the fd number as the first argument. */
- push_constant_text(USE_PT_CHMOD);
- push_constant_text("4");
+ push_text(USE_PT_CHMOD);
+ push_text("4");
f_aggregate(2);
/* Send the pty as both fd 3 and fd 4. */
- push_constant_text("fds");
+ push_text("fds");
ref_push_object(Pike_fp->current_object);
ref_push_object(Pike_fp->current_object);
f_aggregate(2);
f_aggregate_mapping(2);
#else /* USE_CHGPT */
/* chgpt on HPUX doesn't like getting any arguments... */
- push_constant_text(USE_CHGPT);
+ push_text(USE_CHGPT);
f_aggregate(1);
/* chgpt wants to get the pty on fd 0. */
- push_constant_text("stdin");
+ push_text("stdin");
ref_push_object(Pike_fp->current_object);
f_aggregate_mapping(2);
#endif /* USE_PT_CHMOD */
2979: Inside #if !defined(__NT__) && (defined(HAVE_POSIX_OPENPT) || defined(PTY_MASTER_PATHNAME))
#else
if(args > 1)
pop_n_elems(args - 1);
- push_constant_text(PTY_MASTER_PATHNAME);
+ push_text(PTY_MASTER_PATHNAME);
stack_swap();
file_open(2);
#endif
6002: Inside #if defined(HAVE_LINUX_IF_H) && defined(HAVE_SYS_IOCTL_H)
push_text( ifr->ifr_name );
- push_constant_text( "ips" );
+ push_text( "ips" );
memcpy( &addr, &ifr->ifr_addr, sizeof(ifr->ifr_addr) );
push_text( inet_ntoa( addr.sin_addr ) );
f_aggregate(1);