[ruby-cvs:54098] normal:r46952 (trunk): introduce ZALLOC{, _N} to replace ALLOC{, _N}+MEMZERO use

normal at ruby-lang.org normal at ruby-lang.org
Sat Jul 26 06:34:41 JST 2014


normal	2014-07-26 06:34:35 +0900 (Sat, 26 Jul 2014)

  New Revision: 46952

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46952

  Log:
    introduce ZALLOC{,_N} to replace ALLOC{,_N}+MEMZERO use
    
    Using calloc where possible reduces code and binary sizes.
    
    * include/ruby/ruby.h (ZALLOC, ZALLOC_N): implement
      (Data_Make_Struct, TypedData_Make_Struct):
      ZALLOC replaces ALLOC+memset
    * compile.c (iseq_seq_sequence): ZALLOC_N replaces ALLOC_N+MEMZERO
    * cont.c (fiber_t_alloc): ZALLOC replaces ALLOC+MEMZERO
    * io.c (rb_io_reopen): ditto
    * iseq.c (prepare_iseq_build): ditto
    * parse.y (new_args_tail_gen, parser_new, ripper_s_allocate): ditto
    * re.c (match_alloc): ditto
    * variable.c (rb_const_set): ditto
    * ext/socket/raddrinfo.c (get_addrinfo): ditto
    * ext/strscan/strscan.c (strscan_s_allocate): ditto
    * gc.c (rb_objspace_alloc): calloc replaces malloc+MEMZERO

  Modified files:
    trunk/ChangeLog
    trunk/compile.c
    trunk/cont.c
    trunk/ext/socket/raddrinfo.c
    trunk/ext/strscan/strscan.c
    trunk/gc.c
    trunk/include/ruby/ruby.h
    trunk/io.c
    trunk/iseq.c
    trunk/parse.y
    trunk/re.c
    trunk/variable.c


More information about the ruby-cvs mailing list