Branch: Tag:

2014-05-22

2014-05-22 17:13:39 by Per Hedbor <ph@opera.com>

Changed push_text from a macro to a function.

This saves around 12Kb of binary size. And since make_shared_string()
does a lot of work anyway, there will be very little actual change in
speed.

The only drawback is that strlen() is no longer constant-optimized in
the fairly common push_text("str") case.

But doing a checksum of the string is bound to take about a magnitude
more time than strlen anyway.

There is no noticeable change in the 'make benchmark' times, at least.

3062:    }   }    + PMOD_EXPORT push_text( const char *x ) + { +  struct svalue *_sp_ = Pike_sp++; +  SET_SVAL_SUBTYPE(*_sp_, 0); +  _sp_->u.string=make_shared_string(x); +  debug_malloc_touch(_sp_->u.string); +  SET_SVAL_TYPE(*_sp_, PIKE_T_STRING); + } +    /* NOTE: Returns 1 if result on stack, 0 otherwise. */   PMOD_EXPORT int safe_apply_handler(const char *fun,    struct object *handler,