Re: cvs: php4 /ext/dba dba.c dba_cdb.c dba_db2.c dba_db3.c dba_dbm.c dba_flatfile.c dba_gdbm.c dba_ndbm.c
| From: | Sascha Schumann | Date: | Wed, 13 Nov 2002 12:37:51 +0000 |
| Subject: | Re: cvs: php4 /ext/dba dba.c dba_cdb.c dba_db2.c dba_db3.c dba_dbm.c dba_flatfile.c dba_gdbm.c dba_ndbm.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-16082@lists.php.net to get a copy of this message | ||
On Wed, 13 Nov 2002, Marcus Börger wrote:
> At 18:59 06.11.2002, Sascha Schumann wrote:
> >sas Wed Nov 6 12:59:04 2002 EDT
> >
> > Modified files:
> > /php4/ext/dba dba.c dba_cdb.c dba_db2.c dba_db3.c dba_dbm.c
> > dba_flatfile.c dba_gdbm.c dba_ndbm.c
> > Log:
> > emalloc never returns 0, so we can simplify the code paths.
> > also replace ecalloc with emalloc+memset, so that the latter can be
> > inlined.
>
> Could you explain what you meant with the second part?
> ecmalloc is a call that uses memset. If memset can be inlined it would
> be inlined in ecalloc as well as in the other place. In other words i do not
> see the difference.
The difference is the placement of the memset call. After
the changes, a compiler which does not optimize across
function borders can inline the memset call (e.g. GCC).
memset() is a lot faster, if the compiler knows the size of
the data field.
Have a look at the assembler code here
http://www.mail-archive.com/dev@httpd.apache.org/msg02492.html
- Sascha