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

1:   #include "global.h" - RCSID("$Id: threads.c,v 1.88 1999/02/01 04:11:35 hubbe Exp $"); + RCSID("$Id: threads.c,v 1.89 1999/02/10 21:46:58 hubbe Exp $");      int num_threads = 1;   int threads_disabled = 0;
977:    struct program *tmp;    INT32 mutex_key_offset;    -  add_efun("thread_create",f_thread_create,"function(mixed ...:object)", +  + /* function(mixed ...:object) */ +  ADD_EFUN("thread_create",f_thread_create,tFuncV(,tMix,tObj),    OPT_SIDE_EFFECT);   #ifdef UNIX_THREADS -  add_efun("thread_set_concurrency",f_thread_set_concurrency, -  "function(int:void)", OPT_SIDE_EFFECT); +  + /* function(int:void) */ +  ADD_EFUN("thread_set_concurrency",f_thread_set_concurrency,tFunc(tInt,tVoid), OPT_SIDE_EFFECT);   #endif -  add_efun("this_thread",f_this_thread,"function(:object)", +  + /* function(:object) */ +  ADD_EFUN("this_thread",f_this_thread,tFunc(,tObj),    OPT_EXTERNAL_DEPEND); -  add_efun("all_threads",f_all_threads,"function(:array(object))", +  + /* function(:array(object)) */ +  ADD_EFUN("all_threads",f_all_threads,tFunc(,tArr(tObj)),    OPT_EXTERNAL_DEPEND);    -  add_efun("thread_local",f_thread_local,"function(:object)",OPT_SIDE_EFFECT); +     -  + /* function(:object) */ +  ADD_EFUN("thread_local",f_thread_local,tFunc(,tObj),OPT_SIDE_EFFECT); +     start_new_program();    ADD_STORAGE(struct mutex_storage); -  add_function("lock",f_mutex_lock,"function(int|void:object)",0); -  add_function("trylock",f_mutex_trylock,"function(int|void:object)",0); +  /* function(int|void:object) */ +  ADD_FUNCTION("lock",f_mutex_lock,tFunc(tOr(tInt,tVoid),tObj),0); +  /* function(int|void:object) */ +  ADD_FUNCTION("trylock",f_mutex_trylock,tFunc(tOr(tInt,tVoid),tObj),0);    set_init_callback(init_mutex_obj);    set_exit_callback(exit_mutex_obj);    end_class("mutex", 0);
1016:       start_new_program();    ADD_STORAGE(COND_T); -  add_function("wait",f_cond_wait,"function(void|object:void)",0); -  add_function("signal",f_cond_signal,"function(:void)",0); -  add_function("broadcast",f_cond_broadcast,"function(:void)",0); +  /* function(void|object:void) */ +  ADD_FUNCTION("wait",f_cond_wait,tFunc(tOr(tVoid,tObj),tVoid),0); +  /* function(:void) */ +  ADD_FUNCTION("signal",f_cond_signal,tFunc(,tVoid),0); +  /* function(:void) */ +  ADD_FUNCTION("broadcast",f_cond_broadcast,tFunc(,tVoid),0);    set_init_callback(init_cond_obj);    set_exit_callback(exit_cond_obj);    end_class("condition", 0);
1036:       start_new_program();    ADD_STORAGE(struct thread_local); -  add_function("get",f_thread_local_get,"function(:mixed)",0); -  add_function("set",f_thread_local_set,"function(mixed:mixed)",0); +  /* function(:mixed) */ +  ADD_FUNCTION("get",f_thread_local_get,tFunc(,tMix),0); +  /* function(mixed:mixed) */ +  ADD_FUNCTION("set",f_thread_local_set,tFunc(tMix,tMix),0);    thread_local_prog=end_program();    if(!thread_local_prog)    fatal("Failed to initialize thread_local program!\n");
1045:    start_new_program();    thread_storage_offset=ADD_STORAGE(struct thread_state);    thread_id_result_variable=simple_add_variable("result","mixed",0); -  add_function("backtrace",f_thread_backtrace,"function(:array)",0); -  add_function("wait",f_thread_id_result,"function(:mixed)",0); -  add_function("status",f_thread_id_status,"function(:int)",0); +  /* function(:array) */ +  ADD_FUNCTION("backtrace",f_thread_backtrace,tFunc(,tArray),0); +  /* function(:mixed) */ +  ADD_FUNCTION("wait",f_thread_id_result,tFunc(,tMix),0); +  /* function(:int) */ +  ADD_FUNCTION("status",f_thread_id_status,tFunc(,tInt),0);    set_gc_mark_callback(thread_was_marked);    set_gc_check_callback(thread_was_checked);    set_init_callback(init_thread_obj);