Branch: Tag:

1999-02-10

1999-02-10 22:03:31 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

lots of minor optimizations..

Rev: src/builtin_functions.c:1.148
Rev: src/constants.c:1.14
Rev: src/constants.h:1.8
Rev: src/cpp.c:1.33
Rev: src/dynamic_load.c:1.34
Rev: src/module.c:1.10
Rev: src/modules/Gdbm/gdbmmod.c:1.7
Rev: src/modules/Gmp/mpz_glue.c:1.39
Rev: src/modules/Gz/zlibmod.c:1.23
Rev: src/modules/Image/colors.c:1.9
Rev: src/modules/Image/colortable.c:1.48
Rev: src/modules/Image/font.c:1.43
Rev: src/modules/Image/image.c:1.112
Rev: src/modules/Msql/msqlmod.c:1.10
Rev: src/modules/Mysql/mysql.c:1.26
Rev: src/modules/Mysql/result.c:1.15
Rev: src/modules/Odbc/odbc.c:1.14
Rev: src/modules/Odbc/odbc_result.c:1.17
Rev: src/modules/Oracle/oracle.c:1.16
Rev: src/modules/Perl/perlmod.c:1.6
Rev: src/modules/Pipe/pipe.c:1.30
Rev: src/modules/Postgres/pgresult.c:1.10
Rev: src/modules/Postgres/postgres.c:1.12
Rev: src/modules/Regexp/glue.c:1.14
Rev: src/modules/Ssleay/ssleay.c:1.11
Rev: src/modules/Yp/yp.c:1.16
Rev: src/modules/_Charset/charsetmod.c:1.9
Rev: src/modules/_Charset/iso2022.c:1.4
Rev: src/modules/_Crypto/cast.c:1.6
Rev: src/modules/_Crypto/cbc.c:1.14
Rev: src/modules/_Crypto/crypto.c:1.27
Rev: src/modules/_Crypto/des.c:1.13
Rev: src/modules/_Crypto/idea.c:1.13
Rev: src/modules/_Crypto/invert.c:1.8
Rev: src/modules/_Crypto/md2.c:1.6
Rev: src/modules/_Crypto/md5.c:1.12
Rev: src/modules/_Crypto/pipe.c:1.14
Rev: src/modules/_Crypto/rc4.c:1.9
Rev: src/modules/_Crypto/sha.c:1.15
Rev: src/modules/_Image_JPEG/image_jpeg.c:1.20
Rev: src/modules/_Image_TTF/image_ttf.c:1.11
Rev: src/modules/_Image_XFace/image_xface.c:1.6
Rev: src/modules/call_out/call_out.c:1.25
Rev: src/modules/files/efuns.c:1.64
Rev: src/modules/files/socket.c:1.42
Rev: src/modules/math/math.c:1.17
Rev: src/modules/spider/accesseddb.c:1.18
Rev: src/modules/spider/dumudp.c:1.43
Rev: src/modules/spider/spider.c:1.78
Rev: src/modules/spider/xml.c:1.7
Rev: src/modules/sprintf/sprintf.c:1.32
Rev: src/modules/system/nt.c:1.8
Rev: src/modules/system/passwords.c:1.24
Rev: src/modules/system/system.c:1.62
Rev: src/object.c:1.57
Rev: src/operators.c:1.47
Rev: src/pike_macros.h:1.12
Rev: src/pike_types.c:1.50
Rev: src/pike_types.h:1.17
Rev: src/program.c:1.110
Rev: src/program.h:1.51
Rev: src/security.c:1.11
Rev: src/signal_handler.c:1.106
Rev: src/stralloc.h:1.29
Rev: src/svalue.h:1.21
Rev: src/threads.c:1.89

5:   \*/      /* -  * $Id: constants.h,v 1.7 1998/06/06 03:14:42 hubbe Exp $ +  * $Id: constants.h,v 1.8 1999/02/10 21:46:40 hubbe Exp $    */   #ifndef ADD_EFUN_H   #define ADD_EFUN_H
13:   #include "svalue.h"   #include "hashtable.h"   #include "las.h" /* For OPT_SIDE_EFFECT etc. */ + #include "block_alloc_h.h"      typedef int (*docode_fun)(node *n);   typedef node *(*optimize_fun)(node *n);
20:   struct callable   {    INT32 refs; + #ifdef PIKE_SECURITY +  struct object *prot; + #endif    c_fun function;    struct pike_string *type;    struct pike_string *name;    INT16 flags;    optimize_fun optimize;    docode_fun docode; -  +  struct callable *next;   };      /* Prototypes begin here */
33:   void low_add_efun(struct pike_string *name, struct svalue *fun);   void low_add_constant(char *name, struct svalue *fun);   void add_global_program(char *name, struct program *p); + BLOCK_ALLOC(callable,128) + struct callable *low_make_callable(c_fun fun, +  struct pike_string *name, +  struct pike_string *type, +  INT16 flags, +  optimize_fun optimize, +  docode_fun docode);   struct callable *make_callable(c_fun fun,    char *name,    char *type,    INT16 flags,    optimize_fun optimize,    docode_fun docode); - void really_free_callable(struct callable *fun); +    void add_efun2(char *name,    c_fun fun,    char *type,
47:    optimize_fun optimize,    docode_fun docode);   void add_efun(char *name, c_fun fun, char *type, INT16 flags); + void quick_add_efun(char *name, int name_length, +  c_fun fun, +  char *type, int type_length, +  INT16 flags, +  optimize_fun optimize, +  docode_fun docode);   void cleanup_added_efuns(void);   void count_memory_in_callables(INT32 *num_, INT32 *size_);   /* Prototypes end here */    -  +  + #include "pike_macros.h" +  + #define ADD_EFUN(NAME,FUN,TYPE,FLAGS) \ +  quick_add_efun(NAME,CONSTANT_STRLEN(NAME),FUN,TYPE,CONSTANT_STRLEN(TYPE),FLAGS,0,0) +  + #define ADD_EFUN2(NAME,FUN,TYPE,FLAGS,OPTIMIZE,DOCODE) \ +  quick_add_efun(NAME,CONSTANT_STRLEN(NAME),FUN,TYPE,CONSTANT_STRLEN(TYPE),FLAGS,OPTIMIZE,DOCODE)   #endif