[ruby-cvs:61823] naruse:r54661 (trunk): * gc.c (objspace_malloc_prepare): remove size check because it is

naruse at ruby-lang.org naruse at ruby-lang.org
Fri Apr 22 05:59:39 JST 2016


naruse	2016-04-22 05:59:39 +0900 (Fri, 22 Apr 2016)

  New Revision: 54661

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

  Log:
    * gc.c (objspace_malloc_prepare): remove size check because it is
      used by objspace_xmalloc and objspace_xcalloc.
      objspace_xmalloc introduces its own check in this commit.
      objspace_xcalloc checks with xmalloc2_size (ruby_xmalloc2_size).
    
    * gc.c (objspace_xmalloc0): common xmalloc function.
    
    * gc.c (objspace_xmalloc): introduce its own size check.
    
    * gc.c (objspace_xmalloc2): separated from ruby_xmalloc2 to clarify
      the layer who has the responsibility to check the size.
    
    * gc.c (objspace_xrealloc): remove duplicated size check.
    
    * gc.c (ruby_xmalloc2): use objspace_xmalloc2.
    
    * include/ruby/ruby.h (ruby_xmalloc2_size): follow the size limit
      as SSIZE_MAX. Note that ISO C says size_t is unsigned integer.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
    trunk/include/ruby/ruby.h


More information about the ruby-cvs mailing list