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

4902 Коммитов

Автор SHA1 Сообщение Дата
zzak 51c43dba6a * ext/bigdecimal/*: improve documentation, nodoc samples with @mrkn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-13 14:44:25 +00:00
drbrain d341276561 * ext/socket/extconf.rb: Enable RFC 3542 IPV6 socket options for OS X
10.7+.  [ruby-trunk - Bug #8517]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12 20:32:42 +00:00
akr aaa1461d7b * bignum.c (rb_integer_unpack_2comp): New function.
(rb_integer_unpack_internal): Extracted from rb_integer_unpack and
  nlp_bits_ret argument added.
  (integer_unpack_num_bdigits_small): nlp_bits_ret argument added to
  return number of leading padding bits.
  (integer_unpack_num_bdigits_generic): Ditto.

* internal.h (rb_integer_unpack_2comp): Declared.

* pack.c (pack_unpack): Use rb_integer_unpack_2comp and
  rb_integer_unpack.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12 15:18:00 +00:00
shugo 1f828497d1 * safe.c (rb_set_safe_level, safe_setter): raise an ArgumentError
when $SAFE is set to 4.  $SAFE=4 is now obsolete.
  [ruby-core:55222] [Feature #8468]

* object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust):
  Kernel#untrusted?, untrust, and trust are now deprecated.
  Their behavior is same as tainted?, taint, and untaint,
  respectively.

* include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED()
  and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(),
  respectively.

* array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c,
  ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c,
  ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c,
  ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c,
  ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c,
  ext/socket/socket.c, ext/socket/udpsocket.c,
  ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c,
  ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c,
  load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c,
  safe.c, string.c, thread.c, transcode.c, variable.c,
  vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for
  $SAFE=4.

* test/dl/test_dl2.rb, test/erb/test_erb.rb,
  test/readline/test_readline.rb,
  test/readline/test_readline_history.rb, test/ruby/test_alias.rb,
  test/ruby/test_array.rb, test/ruby/test_dir.rb,
  test/ruby/test_encoding.rb, test/ruby/test_env.rb,
  test/ruby/test_eval.rb, test/ruby/test_exception.rb,
  test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb,
  test/ruby/test_io.rb, test/ruby/test_method.rb,
  test/ruby/test_module.rb, test/ruby/test_object.rb,
  test/ruby/test_pack.rb, test/ruby/test_rand.rb,
  test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb,
  test/ruby/test_struct.rb, test/ruby/test_thread.rb,
  test/ruby/test_time.rb: remove tests for $SAFE=4.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12 14:20:51 +00:00
akr 0c9a719d77 * internal.h (INTEGER_PACK_NEGATIVE): Defined.
(rb_integer_unpack): sign argument removed.

* bignum.c (rb_integer_unpack): sign argument removed.
  Non-negative integers generated by default.
  INTEGER_PACK_NEGATIVE flag is used to generate non-positive integers.

* pack.c (pack_unpack): Follow the above change.

* random.c (int_pair_to_real_inclusive): Ditto.
  (make_seed_value): Ditto.
  (mt_state): Ditto.
  (limited_big_rand): Ditto.

* marshal.c (r_object0): Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-11 21:39:55 +00:00
akr 17a5321c40 rb_integer_pack tests refined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-11 13:15:56 +00:00
akr d5a3818f8e * bignum.c (rb_integer_pack_internal): Renamed from rb_integer_pack
and overflow_2comp argument added.
  (rb_integer_pack): Just call rb_integer_pack_internal.
  (rb_integer_pack_2comp): New function.

* internal.h (rb_integer_pack_2comp): Declared.

* sprintf.c (rb_str_format): Use rb_integer_pack and
  rb_integer_pack_2comp to format binary/octal/hexadecimal integers.
  (ruby_digitmap): Declared.
  (remove_sign_bits): Removed.
  (BITSPERDIG): Ditto.
  (EXTENDSIGN): Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-11 12:06:40 +00:00
eregon 8c6674ef03 * ext/racc/cparse/cparse.c: use rb_ary_entry() and
rb_ary_subseq() instead of RARRAY_PTR.
  Based on a patch by Dirkjan Bussink. See Bug #8399.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-10 20:06:53 +00:00
kou e214b1b6d3 * ext/socket/raddrinfo.c (nogvl_getaddrinfo): Fix indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-10 12:51:48 +00:00
kou f6921a3cd1 * ext/socket/raddrinfo.c (nogvl_getaddrinfo): Add missing return
value assignment.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-10 12:50:45 +00:00
naruse 52a802a428 * ext/socket/raddrinfo.c (nogvl_getaddrinfo): work around for Ubuntu
13.04's getaddrinfo issue with mdns4. [ruby-list:49420]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-10 11:59:36 +00:00
akr 0e8caa7d0f * bignum.c (rb_integer_pack): Returns sign instead of words.
(absint_numwords_generic): Follow the above change.
  (big2str_base_powerof2): Follow the above change.

* internal.h: Ditto.

* hash.c (rb_hash): Ditto.

* pack.c (pack_pack): Ditto.

* random.c (int_pair_to_real_inclusive): Ditto.
  (rand_init): Ditto.
  (random_load): Ditto.
  (limited_big_rand): Ditto.

* time.c (v2w_bignum): Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-10 10:37:39 +00:00
akr 837392b452 * bignum.c (rb_integer_pack): numwords_allocated argument removed.
* internal.h (rb_integer_pack): Follow the above change.

* hash.c (rb_hash): Ditto.

* time.c (v2w_bignum): Ditto.

* pack.c (pack_pack): Ditto.

* random.c (int_pair_to_real_inclusive): Ditto.
  (rand_init): Ditto.
  (random_load): Ditto.
  (limited_big_rand): Ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-09 05:53:00 +00:00
akr f31aed6255 * bignum.c (rb_integer_pack): Arguments changed. Use flags to
specify word order and byte order.
  (rb_integer_unpack): Ditto.
  (validate_integer_format): Follow the above change.
  (integer_format_loop_setup): Ditto.

* pack.c: Ditto.

* internal.h: Ditto.
  (INTEGER_PACK_MSWORD_FIRST): Defined.
  (INTEGER_PACK_LSWORD_FIRST): Ditto.
  (INTEGER_PACK_MSBYTE_FIRST): Ditto.
  (INTEGER_PACK_LSBYTE_FIRST): Ditto.
  (INTEGER_PACK_NATIVE_BYTE_ORDER): Ditto.
  (INTEGER_PACK_LITTLE_ENDIAN): Ditto.
  (INTEGER_PACK_BIG_ENDIAN): Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07 15:02:39 +00:00
akr a08b001100 * bignum.c (rb_integer_pack): Renamed from rb_int_export.
(rb_integer_unpack): Renamed from rb_int_import.

* internal.h, pack.c: Follow the above change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07 12:41:02 +00:00
naruse cac2f455a9 * ext/json/fbuffer/fbuffer.h (fbuffer_append_str): change the place of
RB_GC_GUARD. it should be after the object is used.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07 04:45:16 +00:00
nobu 147775ac2b use NUM2SIZET and SIZET2NUM
* configure.in: revert r41106.  size_t may not be unsigned

* bignum.c (rb_absint_size_in_word, rb_int_export, rb_int_import): use
  NUM2SIZET() and SIZET2NUM() already defined in ruby/ruby.h.

* ext/-test-/bignum/export.c (rb_int_export_m): ditto.

* ext/-test-/bignum/import.c (rb_int_import_m): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07 02:41:45 +00:00
akr d1f3d41f11 * internal.h (rb_int_export): countp argument is split into
wordcount_allocated and wordcount.

* bignum.c (rb_int_export): Follow the above change.

* pack.c (pack_pack): Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 22:31:23 +00:00
akr c9c67d2fe0 * bignum.c (rb_int_import): New function.
(int_import_push_bits): Ditto.

* internal.h (rb_int_import): Declared.

* pack.c (pack_unpack): Use rb_int_import for BER compressed integer.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 21:20:04 +00:00
akr 58eac2494f Specify dependencies.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 12:58:25 +00:00
akr 9fea8758e9 * configure.in: Invoke RUBY_REPLACE_TYPE for size_t.
Don't invoke RUBY_CHECK_PRINTF_PREFIX for size_t to avoid conflict
  with RUBY_REPLACE_TYPE.

* internal.h (rb_absint_size): Declared.
  (rb_absint_size_in_word): Ditto.
  (rb_int_export): Ditto.

* bignum.c (rb_absint_size): New function.
  (rb_absint_size_in_word): Ditto.
  (int_export_fill_dd): Ditto.
  (int_export_take_lowbits): Ditto.
  (rb_int_export): Ditto.

* pack.c (pack_pack): Use rb_int_export for BER compressed integer.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 11:57:35 +00:00
tadf c247e62808 * ext/date/date_core.c: fixed coding error [ruby-core:55337].
reported by Riley Lynch.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 10:33:48 +00:00
nari fbece268c7 * ext/objspace/object_tracing.c: rename allocation_info to
lookup_allocation_info. At times I confused "struct
  allocation_info" with "function allocation_info".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 05:18:40 +00:00
nari 15d26c3fd9 * ext/objspace/object_tracing.c: allocation_info function isn't
called by any other file.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06 05:10:31 +00:00
tadf 4eabe8193a * ext/date/date_core.c (d_lite_cmp, d_lite_equal): simplified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04 22:18:12 +00:00
tadf 551bcc6364 * ext/date/date_core.c: fixed a bug [ruby-core:55295]. reported
by Riley Lynch.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04 22:09:36 +00:00
eregon 71b6077a53 * ext/objspace/objspace.c: improve wording and remove duplicated comment.
Based on a patch by Dave Goodchild. [Fixes GH-299]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04 14:09:25 +00:00
mrkn 1699396fe5 * ext/bigdecimal/lib/bigdecimal/util.rb (Float#to_d): fix the number
of figures.  Patch by Vipul A M <vipulnsward@gmail.com>.
  https://github.com/ruby/ruby/pull/323  fix GH-323

* test/bigdecimal/test_bigdecimal_util.rb: fix for the above change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04 06:37:44 +00:00
naruse e2582ca28d * ext/socket/option.c: rename functions introduced in r41009
s/ip/ipv4/g because they are ipv4 functions.
  (there's a policy that the name "ip" is for methods which supports
   both ipv4 and ipv6)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-02 14:24:34 +00:00
nobu aa8cc01aa3 zlib.c: check EOF
* ext/zlib/zlib.c (gzfile_read, gzfile_read_all, gzfile_getc),
  (gzreader_gets): check EOF.  [ruby-core:55220] [Bug #8467]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31 23:00:48 +00:00
nobu 488f478d24 * ext/socket/option.c (inspect_byte): used only on NetBSD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31 22:53:58 +00:00
naruse a78e45b5fe * ext/socket/option.c (sockopt_s_byte): constructor of the sockopt
whose value's is byte.

* ext/socket/option.c (sockopt_byte): getter for above.

* ext/socket/option.c (inspect_byte): inspect for above.

* ext/socket/option.c (sockopt_s_ip_multicast_loop): constructor of
  the sockopt whose optname is IP_MULTICAST_LOOP.

* ext/socket/option.c (sockopt_ip_multicast_loop): getter for above.

* ext/socket/option.c (sockopt_s_ip_multicast_ttl): constructor of
  the sockopt whose optname is IP_MULTICAST_TTL.

* ext/socket/option.c (sockopt_ip_multicast_ttl): getter for above.

* ext/socket/option.c (sockopt_inspect): use above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31 17:37:55 +00:00
mrkn 1db209763a * ext/bigdecimal/bigdecimal.c (BigDecimal_power): use rb_dbl2big
to convert a double value to a Bignum.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31 16:59:09 +00:00
zzak ee0478bce9 * ext/openssl/ossl_ssl.c: Add missing paren in rdoc [Fix GH-321]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31 07:02:11 +00:00
tmm1 0a814e9b13 fix typo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-28 20:57:14 +00:00
nobu 7d3fbdeacb object_tracing.c: fix argument type
* ext/objspace/object_tracing.c (make_unique_str): fix argument type.
  use long for string length.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-28 04:52:07 +00:00
ko1 7453c53b08 * ext/objspace/object_tracing.c: fix a bug reported at
"[ruby-core:55182] [ruby-trunk - Bug #8456][Open] Sugfault in Ruby Head"
  Care about the case TracePoint#path #=> `nil'.
* ext/objspace/object_tracing.c: add two new methods:
* ObjectSpace.allocation_class_path(o)
* ObjectSpace.allocation_method_id(o)
  They are not useful for Object.new because they are always
  "Class" and :new.
  To trace more useful information, we need to maintain call-tree
  using call/return hooks, which is implemented by
  ll-prof <http://sunagae.net/wiki/doku.php?id=software:llprof>
* test/objspace/test_objspace.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-28 03:36:34 +00:00
nobu b0e7ec8c9a extmk.rb: untouch makefiles
* ext/extmk.rb (extmake): leave makefiles untouched if the content is
  not changed, to get rid of unnecessary re-linking.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-28 02:30:13 +00:00
nobu c9f982d4e8 ext/objspace: unexpand Author keywords
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-28 02:23:52 +00:00
nobu 40fe524bf3 * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 18:16:05 +00:00
ko1 30dbed3837 * ext/objspace/gc_hook.c, ext/objspace/objspace.c: add new methods to
hook GC invocation.
* ObjectSpace.after_gc_start_hook=(proc)
* ObjectSpace.after_gc_end_hook=(proc)
  Note that hooks are not kicked immediately. Procs are kicked
  at postponed_job.
  This feature is a sample of new internal event and
  rb_postponed_job API.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 18:14:28 +00:00
ko1 c180e0d880 * vm_trace.c (rb_postponed_job_register_one): fix iteration bug.
* ext/-test-/postponed_job/postponed_job.c,
  test/-ext-/postponed_job/test_postponed_job.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 17:08:25 +00:00
nobu 462804fce4 suppress warnings
* ext/-test-/postponed_job/postponed_job.c (pjob_register),
  (pjob_call_direct): none void function.

* ext/-test-/tracepoint/tracepoint.c (tracepoint_track_objspace_events):
  adjust type to get rid of implicit cast.

* ext/objspace/object_tracing.c (newobj_i): ditto.

* ext/tk/tkutil/tkutil.c (tk_conv_args): adjust type against
  RHASH_SIZE().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 16:48:15 +00:00
ko1 e4c58251b7 * include/ruby/ruby.h, gc.c: add new internal event
RUBY_INTERNAL_EVENT_GC_END. This event invokes at the end of
  after_sweep().
  Time chart with lazy sweep is here:
  (1) Kick RUBY_INTERNAL_EVENT_GC_START
  (2) [gc_marks()]
  (3) [lazy_sweep()]
  (4) [... run Ruby program (mutator) with lazy_sweep() ...]
  (5) [after_sweep()]
  (6) Kick RUBY_INTERNAL_EVENT_GC_END
  (7) [... run Ruby program (mutator), and go to (1) ...]
* ext/-test-/tracepoint/tracepoint.c,
  test/-ext-/tracepoint/test_tracepoint.rb: modify a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 15:40:27 +00:00
ko1 f0b6cb6fc7 * include/ruby/ruby.h: rename RUBY_INTERNAL_EVENT_FREE to
RUBY_INTERNAL_EVENT_FREEOBJ.
* ext/-test-/tracepoint/tracepoint.c,
  ext/objspace/object_tracing.c,
  gc.c, vm_trace.c: catch up this change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 10:28:25 +00:00
ko1 050dd10d6f * ext/objspace/objspace.c: support ObjectSpace.trace_object_allocations.
Read the following test to know HOWTO.
  This feature is a sample of RUBY_INTERNAL_EVENT.
* test/objspace/test_objspace.rb: add a test.
* ext/objspace/object_tracing.c: ditto.
* gc.c (rb_gc_count): add. THis function returns GC count.
* internal.h: add decl. of rb_gc_count(). Same as `GC.count'.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 10:01:45 +00:00
ko1 680f0b5ba4 * include/ruby/ruby.h, gc.c, vm_trace.c: add internal events.
* RUBY_INTERNAL_EVENT_NEWOBJ: object created.
* RUBY_INTERNAL_EVENT_FREE: object freeed.
* RUBY_INTERNAL_EVENT_GC_START: GC started.
  And rename `RUBY_EVENT_SWITCH' to `RUBY_INTERNAL_EVENT_SWITCH'.
  Internal events can not invoke any Ruby program because the tracing
  timing may be critical (under huge restriction).
  These events can be hooked only by C-extensions.
  We recommend to use rb_potponed_job_register() API to call Ruby
  program safely.
  This change is mostly written by Aman Gupta (tmm1).
  https://bugs.ruby-lang.org/issues/8107#note-12
  [Feature #8107]
* include/ruby/debug.h, vm_trace.c: added two new APIs.
* rb_tracearg_event_flag() returns rb_event_flag_t of this event.
* rb_tracearg_object() returns created/freeed object.
* ext/-test-/tracepoint/extconf.rb,
  ext/-test-/tracepoint/tracepoint.c,
  test/-ext-/tracepoint/test_tracepoint.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27 00:21:02 +00:00
ko1 96090c083d * ext/-test-/postponed_job/postponed_job.c: fix `init' function name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-26 23:40:01 +00:00
ko1 e2793a908e * include/ruby/debug.h, vm_trace.c: add rb_postponed_job API.
Postponed jobs are registered with this API. Registered jobs
  are invoked at `ruby-running-safe-point' as soon as possible.
  This timing is completely same as finalizer timing.
  There are two APIs:
* rb_postponed_job_register(flags, func, data): register a
  postponed job with data. flags are reserved.
* rb_postponed_job_register_one(flags, func, data): same as
  `rb_postponed_job_register', but only one `func' job is
  registered (skip if `func' is already registered).
  This change is mostly written by Aman Gupta (tmm1).
  https://bugs.ruby-lang.org/issues/8107#note-15
  [Feature #8107]
* gc.c: use postponed job API for finalizer.
* common.mk: add dependency from vm_trace.c to debug.h.
* ext/-test-/postponed_job/extconf.rb, postponed_job.c,
  test/-ext-/postponed_job/test_postponed_job.rb: add a test.
* thread.c: implement postponed API.
* vm_core.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-26 21:30:44 +00:00
ko1 a20a14727f * hash.c, include/ruby/ruby.h: support WB protected hash.
* constify RHash::ifnone and make new macro RHASH_SET_IFNONE().
* insert write barrier for st_update().
* include/ruby/intern.h: declare rb_hash_set_ifnone(hash, ifnone).
* marshal.c (r_object0): use RHASH_SET_IFNONE().
* ext/openssl/ossl_x509name.c (Init_ossl_x509name): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-26 12:37:11 +00:00