Граф коммитов

30872 Коммитов

Автор SHA1 Сообщение Дата
ko1 9b6b3672cc * include/ruby/ruby.h: enable RGENGC (USE_RGENGC)
but no type creates write protected (sunny) objects
  (RGENGC_WB_PROTECTED_* == 0).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 18:14:01 +00:00
ko1 4f401816ff * gc.c: support RGENGC. [ruby-trunk - Feature #8339]
See this ticet about RGENGC.
* gc.c: Add several flags:
* RGENGC_DEBUG: if >0, then prints debug information.
* RGENGC_CHECK_MODE: if >0, add assertions.
* RGENGC_PROFILE: if >0, add profiling features.
  check GC.stat and GC::Profiler.
* include/ruby/ruby.h: disable RGENGC by default (USE_RGENGC == 0).
* array.c: add write barriers for T_ARRAY and generate sunny objects.
* include/ruby/ruby.h (RARRAY_PTR_USE): added. Use this macro if
  you want to access raw pointers. If you modify the contents which
  pointer pointed, then you need to care write barrier.
* bignum.c, marshal.c, random.c: generate T_BIGNUM sunny objects.
* complex.c, include/ruby/ruby.h: add write barriers for T_COMPLEX
  and generate sunny objects.
* rational.c (nurat_s_new_internal), include/ruby/ruby.h: add write
  barriers for T_RATIONAL and generate sunny objects.
* internal.h: add write barriers for RBasic::klass.
* numeric.c (rb_float_new_in_heap): generate sunny T_FLOAT objects.
* object.c (rb_class_allocate_instance), range.c:
  generate sunny T_OBJECT objects.
* string.c: add write barriers for T_STRING and generate sunny objects.
* variable.c: add write barriers for ivars.
* vm_insnhelper.c (vm_setivar): ditto.
* include/ruby/ruby.h, debug.c: use two flags
  FL_WB_PROTECTED and FL_OLDGEN.
* node.h (NODE_FL_CREF_PUSHED_BY_EVAL, NODE_FL_CREF_OMOD_SHARED):
  move flag bits.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 18:07:47 +00:00
ko1 7958c71ee5 * gc.c: remove rb_objspace_t::marked_num.
We can use `objspace_live_num()' instead of removed `marked_num'
  if it is after `after_gc_sweep()' function call.
* gc.c (after_gc_sweep): use objspace_live_num() instead of removed
  rb_objspace_t::marked_num.
* gc.c (gc_mark_ptr, gc_marks): remove rb_objspace_t::marked_num code.
* gc.c (gc_prepare_free_objects): do not call set_heaps_increment()
  with checking objspace->heap.marked_num. At this point, we only
  need to check availability of free-cell.
* gc.c (gc_prepare_free_objects):
* gc.c (lazy_sweep): call after_gc_sweep() if there are no sweep_able entry.
* gc.c (rest_sweep, gc_prepare_free_objects): remove after_gc_sweep() call.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 17:02:50 +00:00
ko1 b597df707e * gc.c: disable GC_PROFILE_MORE_DETAIL (fix last commit).
* gc.c (gc_prof_set_malloc_info): fix "objspace->heap.live_num" to
  "objspace_live_num(objspace)". There is no such member variable.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 16:52:49 +00:00
ko1 7d0a90e9b4 * gc.c: refactoring GC::Profiler.
* gc.c (gc_prof_sweep_timer_start/stop): removed because
  they doesn't support lazy sweep.
* gc.c (gc_prof_sweep_slot_timer_start/stop): added.
  redefine `sweeping time' to accumulated time of all of
  slot_sweep().
* gc.c (rb_objspace_t::profile::count): renamed to
  rb_objspace_t::profile::next_index. `counter' seems ambiguous.
  increment it when next record is acquired.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 16:34:25 +00:00
svn e23941ff35 * 2013-05-14
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 15:55:13 +00:00
ko1 89e6910f04 * include/ruby/ruby.h: constify RRational::(num,den) and
RComplex::(real,imag).
  Add macro to set these values:
* RRATIONAL_SET_NUM()
* RRATIONAL_SET_DEN()
* RCOMPLEX_SET_REAL()
* RCOMPLEX_SET_IMAG()
  This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
  TODO: API design. RRATIONAL_SET(rat,num,den) is enough?
  TODO: Setting constify variable with cast has same issue of r40691.
* complex.c, rational.c: use above macros.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 15:55:09 +00:00
eregon 8ccd658e54 * include/ruby/ruby.h: fix a typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 14:41:08 +00:00
kazu b86ebc1fd4 fix typos
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 13:39:21 +00:00
akr 2ad4c65b54 * ext/socket/extconf.rb: Check socketpair again.
It is required on Unix.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 12:51:38 +00:00
usa dd4687313c * win32/win32.c (getipaddrs): use alternamtive interface name if
available, because if_nametoindex() requires them.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 12:21:53 +00:00
usa cb3fcdcdc3 * win32/win32.c, include/ruby/win32.h (getipaddrs): [experimental]
emulate getipaddrs(3) on Unix.

* win32/Makefile.sub, configure.in (LIBS): need iphlpapi.lib for above
  function.

* include/ruby/win32.h (socketpair): rb_w32_socketpair() doesn't
  substitute for any function, so use non-prefixed name.

* ext/socket/extconf.rb (socketpair); follow above change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 11:29:32 +00:00
ko1 f1eadb0fb4 * iseq.c (prepare_iseq_build): remove additional line braek.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 11:11:53 +00:00
ko1 83aba04862 * include/ruby/ruby.h: constify RBasic::klass and add
RBASIC_CLASS(obj) macro which returns a class of `obj'.
  This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
* object.c: add new function rb_obj_reveal().
  This function reveal interal (hidden) object by rb_obj_hide().
  Note that do not change class before and after hiding.
  Only permitted example is:
  klass = RBASIC_CLASS(obj);
  rb_obj_hide(obj);
  ....
  rb_obj_reveal(obj, klass);
  TODO: API design. rb_obj_reveal() should be replaced with others.
  TODO: modify constified variables using cast may be harmful for
  compiler's analysis and optimizaton.
  Any idea to prohibt inserting RBasic::klass directly?
  If rename RBasic::klass and force to use RBASIC_CLASS(obj),
  then all codes such as `RBASIC(obj)->klass' will be
  compilation error. Is it acceptable? (We have similar
  experience at Ruby 1.9,
  for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)".
* internal.h: add some macros.
* RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal
  object.
* RBASIC_SET_CLASS(obj, cls) set RBasic::klass.
* RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS
  without write barrier (planned).
* RCLASS_SET_SUPER(a, b) set super class of a.
* array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c,
  file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c,
  parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c,
  string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c:
  Use above macros and functions to access RBasic::klass.
* ext/coverage/coverage.c, ext/readline/readline.c,
  ext/socket/ancdata.c, ext/socket/init.c,
* ext/zlib/zlib.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 10:49:11 +00:00
ko1 aacd771046 * *.c, parse.y, insns.def: use RARRAY_AREF/ASET macro
instead of using RARRAY_PTR().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 09:56:22 +00:00
ko1 12bf73637b * include/ruby/ruby.h: add new utility macros to access
Array's element.
* RARRAY_AREF(a, i) returns i-th element of an array `a'
* RARRAY_ASET(a, i, v) set i-th element of `a' to `v'
  This change is a part of RGENGC branch [ruby-trunk - Feature #8339].



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 09:41:48 +00:00
ko1 c8fc37a99c * ChangeLog: add a comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 06:43:08 +00:00
ko1 b6b85f6eaf * object.c (rb_obj_setup): added.
* include/ruby/ruby.h (OBJSETUP): ues rb_obj_setup() instead of
  a macro.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 06:33:48 +00:00
ko1 8ac05ae500 * gc.c (rb_data_object_alloc): check klass only if klass is not 0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 06:25:33 +00:00
ko1 925c936bb1 * gc.c (rb_data_object_alloc, rb_data_typed_object_alloc):
use NEWOBJ_OF() instead of NEWOBJ().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 06:03:00 +00:00
nobu 0824f9f224 proc.c: Kernel#singleton_method
* proc.c (rb_obj_singleton_method): new method Kernel#singleton_method
  which returns a Method object of the singleton method.
  non-singleton method causes NameError, but not aliased or zsuper
  method, right now.
  [ruby-core:54914] [Feature #8391]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 05:52:03 +00:00
nobu 3048508014 vm_method.c: rb_method_entry_at
* vm_method.c (rb_method_entry_at): return the method entry for id at
  klass, without ancestors.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 05:51:14 +00:00
nobu 609c7420d7 class.c: rb_singleton_class_get
* class.c (rb_singleton_class_get): get the singleton class if exists,
  or nil.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 05:50:38 +00:00
nobu 111c791c37 class.c: adjust indent
* class.c (singleton_class_of): adjust indent.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 05:49:47 +00:00
yugui ee22fad45d * ext/openssl/ossl_ssl.c: Disabled OpenSSL::SSL::SSLSocket if
defined(OPENSSL_NO_SOCK).

  This fixes a linkage error on platforms which do not have socket.
  OpenSSL itself is still useful as a set of cryptographic functions
  even on such platforms.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 02:08:59 +00:00
zzak 0dc6dcfb6a * hash.c: Hash[] and {} are not equivalent by @eam [Fixes GH-301]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 01:31:27 +00:00
svn 793c5ae865 * 2013-05-13
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 01:07:55 +00:00
zzak 4813d8713c * random.c: Document Random::DEFAULT by @eLobato [Fixes GH-304]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 01:07:50 +00:00
nagachika 00096bdf0d * ChangeLog: fix a typo of r40667.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 13:51:54 +00:00
nobu d2b4011a94 ruby.h: OFFT2NUM redefinition
* include/ruby/ruby.h (OFFT2NUM): RUBY_REPLACE_TYPE also defines macro
  to convert int type to VALUE if found.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 12:13:01 +00:00
kazu fa1e2d957e fix typos
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 09:47:02 +00:00
kosaki 2b881310f8 * include/ruby/intern.h (rb_iv_set, rb_iv_get): removed. Bcause
ruby.h has a declaration for that.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 09:02:10 +00:00
kosaki f3c9bb063e * include/ruby/intern.h (rb_uint2big, rb_int2big, rb_uint2inum)
(rb_int2inum, rb_ll2inum, rb_ull2inum): removed because ruby.h
  has a declaration for these.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 09:01:57 +00:00
kosaki 6591e26eb2 * configure.in: removes 'ac_cv_func_fseeko=yes' form MinGW
specific definitions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 08:53:40 +00:00
kosaki 96ffcf557b * file.c (rb_file_s_truncate): use correct type. chsize takes
a long.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 08:42:30 +00:00
kosaki 93d061a8fd * process.c: move '#define SPAWNV 1' to win32/Makefile.sub.
* win32/Makefile.sub: see above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 08:42:19 +00:00
kosaki 82330e919b * configure.in: removes AC_CHECK_FUNCS(setitimer) because it's
unsed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 08:42:09 +00:00
kosaki 3f6b5aa2f8 * configure.in: removes AC_CHECK_FUNCS(pause) because it's unused.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 08:41:57 +00:00
kosaki c0a30fcbf9 * signal.c (rb_f_kill): fixes typo. s/HAS_KILLPG/HAVE_KILLPG/.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 08:41:46 +00:00
kosaki 59a3943a67 * configure.in: abort if gettimeofday doesn't exist.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 08:41:36 +00:00
kosaki 05628d3b6d * configure.in: removes AC_CHECK_FUNC(ftruncate64).
* configure.in: adds RUBY_REPLACE_TYPE(off_t) for creating
  NUM2OFFT.
* file.c (rb_file_truncate): use correct type. chsize() take
  a long.
* include/ruby/ruby.h (NUM2OFFT): use a definition created by
  a configure script by default.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 08:41:24 +00:00
kosaki e79f790798 * configure.in: removes AC_CHECK_FUNC(fseeko, fseeko64, ftello,
ftello64). They are not used from anywhere.

* win32/win32.c (fseeko): removes.
* win32/win32.c (rb_w32_ftello): removes.
* include/ruby/win32.h: removes declarations of rb_w32_ftello and
  rb_w32_fseeko.
* win32/Makefile.sub: removes '#define HAVE_FTELLO 1'.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 08:41:12 +00:00
kosaki 2d0c7e37bf * configure.in: remove AC_CHECK_FUNC(close). It is not used from
anywhere.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 08:40:59 +00:00
kosaki f15d3ff927 * configure.in: adds comments for setjmp check.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 08:40:47 +00:00
kosaki a79cccb5c6 * configure.in: move clock_gettime() check into regular place.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 08:40:35 +00:00
kosaki 7776ca930b * configure.in: add getenv() declaration check.
* dln_find.c: add HAVE_DECL_GETENV test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 08:40:24 +00:00
kosaki fa5db01644 * configure.in: sorts AC_CHECK_FUNCS()s as alphabetical order.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 08:40:12 +00:00
kosaki 2f6cab0f59 * bignum.c: remove redundant decl for big_lshift() big_rshift().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 08:40:00 +00:00
naruse 5aa618819b * ext/socket/rubysocket.h (rsock_inspect_sockaddr): as r40646
check HAVE_TYPE_STRUCT_SOCKADDR_DL.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 07:09:26 +00:00
kazu 7da6744329 fix a typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-12 02:33:48 +00:00