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

5104 Коммитов

Автор SHA1 Сообщение Дата
zzak c19118417e * ext/dl/cfunc.c: [DOC] fix typo in example [Bug #8944]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09 05:29:59 +00:00
tmm1 d0d6e2ecfa * ext/objspace/object_tracing.c: Add experimental methods to dump
objectspace as json: ObjectSpace.dump_all and ObjectSpace.dump(obj).
These methods are useful for debugging reference leaks and memory growth
in large ruby applications. [Bug #9026] [ruby-core:57893] [Fixes GH-423]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-08 17:06:55 +00:00
zzak 2cfdbd7d72 * ext/objspace/object_tracing.c: [DOC] trace_object_allocations_stop
By @srawlins [Fixes GH-421] https://github.com/ruby/ruby/pull/421


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-07 17:44:43 +00:00
tenderlove 9ae2651d19 * ext/psych/lib/psych/visitors/to_ruby.rb: process merge keys before
reviving objects. Fixes GH psych #168
* test/psych/test_merge_keys.rb: test for change
  https://github.com/tenderlove/psych/issues/168

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-05 19:15:40 +00:00
nobu 7f23534b1f pty.c: check error of seteuid
* ext/pty/pty.c (chfunc): check error of seteuid and return error
  message, to suppress unused-value warning.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-05 08:10:34 +00:00
ko1 d1674ef67b * gc.c: add support to estimate increase of oldspace memory usage.
This is another approach to solve an issue discussed at r43530.
  This feature is diabled as default.
  This feature measures an increment of memory consuption by oldgen
  objects. It measures memory consumption for each objects when
  the object is promoted. However, measurement of memory consumption
  is not accurate now. So that this measurement is `estimation'.
  To implement this feature, move memsize_of() function from
  ext/objspace/objspace.c and expose rb_obj_memsize_of().
  Some memsize() functions for T_DATA (T_TYPEDDATA) have problem to
  measure memory size, so that we ignores T_DATA objects now.
  For example, some functions skip NULL check for pointer.
  The macro RGENGC_ESTIMATE_OLDSPACE enables/disables this feature,
  and turned off as default.
  We need to compare 3gen GC and this feature carefully.
  (it is possible to enable both feature)
  We need a help to compare them.
* internal.h: expose rb_obj_memsize_of().
* ext/objspace/objspace.c: use rb_obj_memsize_of() function.
* cont.c (fiber_memsize): fix to check NULL.
* variable.c (autoload_memsize): ditto.
* vm.c (vm_memsize): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-05 04:51:01 +00:00
tenderlove 06c6dcee25 * ext/psych/lib/psych/visitors/yaml_tree.rb: make less garbage when
testing if a string is binary.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29 18:25:57 +00:00
tenderlove e0c6dd91a4 * ext/psych/lib/psych/visitors/yaml_tree.rb: string subclasses should
not be considered to be binary.  Fixes Psych / GH 166
  https://github.com/tenderlove/psych/issues/166

* test/psych/test_string.rb: test for fix

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29 18:10:24 +00:00
ko1 c5e08b764e * add RUBY_TYPED_FREE_IMMEDIATELY to data types which only use
safe functions during garbage collection such as xfree().
  On default, T_DATA objects are freed at same points as fianlizers.
  This approach protects issues such as reported by [ruby-dev:35578].
  However, freeing T_DATA objects immediately helps heap usage.
  Most of T_DATA (in other words, most of dfree functions) are safe.
  However, we turned off RUBY_TYPED_FREE_IMMEDIATELY by default
  for safety.
* cont.c: ditto.
* dir.c: ditto.
* encoding.c: ditto.
* enumerator.c: ditto.
* error.c: ditto.
* file.c: ditto.
* gc.c: ditto.
* io.c: ditto.
* iseq.c: ditto.
* marshal.c: ditto.
* parse.y: ditto.
* proc.c: ditto.
* process.c: ditto.
* random.c: ditto.
* thread.c: ditto.
* time.c: ditto.
* transcode.c: ditto.
* variable.c: ditto.
* vm.c: ditto.
* vm_backtrace.c: ditto.
* vm_trace.c: ditto.
* ext/bigdecimal/bigdecimal.c: ditto.
* ext/objspace/objspace.c: ditto.
* ext/stringio/stringio.c: ditto.
* ext/strscan/strscan.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29 11:16:54 +00:00
akr a69756de67 * ext/readline/readline.c (readline_getc): Consider
NULL as input.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29 03:09:00 +00:00
akr d3e84880ad * ext/-test-/file/depend, ext/-test-/postponed_job/depend,
ext/-test-/tracepoint/depend: New files for dependencies.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-28 12:36:23 +00:00
nobu 8f675f0b89 openssl: work around of dependency
* ext/openssl/depend (ossl.o): work around of dependency of
  thread_native.h, which depends on headers by THREAD_MODEL.
  [ruby-dev:47777]
* ext/openssl/extconf.rb: need THREAD_MODEL.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-28 06:32:24 +00:00
akr 674f14a0bc * common.mk, ext/objspace/depend, ext/coverage/depend,
ext/-test-/debug/depend, ext/date/depend: Update dependencies.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-28 03:43:17 +00:00
akr d5dad14041 * ext/readline/readline.c: Include ruby/thread.h for
rb_thread_call_without_gvl2.
  (readline_rl_instream, readline_rl_outstream): Record FILE
  structures allocated by this extension.
  (getc_body): New function extracted from readline_getc.
  (getc_func): New function.
  (readline_getc): Use rb_thread_call_without_gvl2 to invoke getc_func.
  [ruby-dev:47033] [Bug #8749]
  (clear_rl_instream, clear_rl_outstream): Close FILE structure
  allocated by this extention reliably.  [ruby-core:57951] [Bug #9040]
  (readline_readline): Use clear_rl_instream and clear_rl_outstream.
  (readline_s_set_input): Set readline_rl_instream.
  (readline_s_set_output): Set readline_rl_outstream.
  (Init_readline): Don't call readline_s_set_input because
  readline_getc doesn't block other threads for any FILE structure now.

  [ruby-dev:47033] [Bug #8749] reported by Nobuhiro IMAI.
  [ruby-core:57951] [Bug #9040] reporeted by Eamonn Webster.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-27 12:04:14 +00:00
nobu 347e748bdd variable.c: real class name
* variable.c (rb_class2name): should return real class name, not
  singleton class or iclass.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-19 20:24:30 +00:00
nobu d51f0dde89 bug_reporter.c: suppress warnings
* ext/-test-/bug_reporter/bug_reporter.c (sample_bug_reporter): cast
  via uintptr_t to suppress warning cast between pointer and different
  size integer by gcc 4.8.

* ext/-test-/bug_reporter/bug_reporter.c (register_sample_bug_reporter):
  ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-17 12:49:16 +00:00
ko1 3f28280782 * ext/objspace/object_tracing.c (newobj_i): fix memory leak.
There is possibility to remain info due to missing FREEOBJ event.
  FREEOBJ events are skipped while suppress_tracing state, for example,
  during trace events are invoking.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-17 05:07:21 +00:00
nobu 6944271c0d bug_reporter.c: suppress warnings
* ext/-test-/bug_reporter/bug_reporter.c (register_sample_bug_reporter):
  cast to suppress warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-17 01:38:04 +00:00
nobu dee91b534a * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-17 01:10:35 +00:00
ko1 3304eb208a * ext/objspace/object_tracing.c (newobj_i): add workaround.
some bugs hits this check.
* ext/objspace/object_tracing.c (object_allocations_reporter_i): cast as pointer.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16 23:09:41 +00:00
zzak 86c24c4430 * ext/curses/curses.c: [DOC] Cleaned up formatting consistency of rdoc
comments for Curses, including period spacing and column width.

  This patch also fixed some typos. Thanks to @postmodern for the patch!
  [Fixes GH-420] https://github.com/ruby/ruby/pull/420


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16 22:12:43 +00:00
zzak ccc78addd2 * ext/date/date_core.c: [DOC] plural grammar fixed by @scott113341
Contributed via documenting-ruby.org: documenting-ruby/ruby#16
  https://github.com/documenting-ruby/ruby/pull/16


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16 22:01:27 +00:00
zzak 64afa78e8a * ext/io/nonblock/nonblock.c: [DOC] Document io/nonblock by reprah
[Fixes GH-418] https://github.com/ruby/ruby/pull/418 based on the
  original discussion from documenting-ruby/ruby#18


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16 20:54:23 +00:00
ko1 17e1c7237b * ext/objspace/object_tracing.c: add new method
ObjectSpace.trace_object_allocations_debug_start for GC debugging.
  If you encounter the BUG "... is T_NONE" (and so on) on your
  application, please try this method at the beggining of your app.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16 20:21:04 +00:00
zzak 8ead78806c * ext/io/nonblock/nonblock.c: use rb_cIO instead of VALUE
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16 13:36:19 +00:00
ko1 955a38da08 * error.c, internal.h (rb_bug_reporter_add): add a new C-API.
rb_bug_reporter_add() allows to register a function which
  is called at rb_bug() called.
* ext/-test-/bug_reporter/bug_reporter.c: add a test for this C-API.
* ext/-test-/bug_reporter/extconf.rb: ditto.
* test/-ext-/bug_reporter/test_bug_reporter.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16 08:39:39 +00:00
ko1 ede6826186 * ext/objspace/objspace.c: add a new method `reachable_objects_from_root'.
ObjectSpace.reachable_objects_from_root returns all objects refered
  from root (called "root objects").
  This feature is for deep object analysis.
* test/objspace/test_objspace.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16 06:13:41 +00:00
nobu 3976eb12ff mkmf.rb: fix framework option
* lib/mkmf.rb (have_framework): should append framework options to
  $LIBS, not $LDFLAGS.  the former is propagated to exts.mk when
  enable-static-linked-ext.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-14 02:07:51 +00:00
ko1 33ab98f9e6 * ext/objspace/gc_hook.c: prohibit reentrant.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-11 09:13:18 +00:00
ko1 b753b9606e * include/ruby/debug.h,
vm_backtrace.c (rb_profile_frame_full_label): add new C API
  rb_profile_frame_full_label() which returns label with
  qualified method name.
  Note that in future version of Ruby label() may return
  same return value of full_label().
* ext/-test-/debug/profile_frames.c,
  test/-ext-/debug/test_profile_frames.rb: fix a test for this change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-09 00:21:51 +00:00
ko1 cff2b2b666 * vm_backtrace.c, include/ruby/debug.h: add new APIs
* VALUE rb_profile_frame_method_name(VALUE frame)
* VALUE rb_profile_frame_qualified_method_name(VALUE frame)
* iseq.c (rb_iseq_klass), internal.h: add new internal function
  rb_iseq_method_name().
* ext/-test-/debug/profile_frames.c (profile_frames),
  test/-ext-/debug/test_profile_frames.rb: add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-08 12:08:20 +00:00
ko1 ef7df5a414 * ext/-test-/debug/profile_frames.c:
test/-ext-/debug/test_profile_frames.rb: add a test for new C-APIs.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-07 07:35:21 +00:00
zzak 8015397318 * ext/dbm/dbm.c: [DOC] Fix wrong constant name in DBM by @edward
[Fixes GH-409] https://github.com/ruby/ruby/pull/409


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-04 10:56:27 +00:00
nobu 13e60f2bff * ext/thread/thread.c (ALIAS_GLOBAL_CONST): fix typo, GLOBCAL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-02 18:20:17 +00:00
nobu cb2b598024 * ext/thread/thread.c (Init_thread): move outer module condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-02 18:20:14 +00:00
mame a6ae6a8b17 * ext/socket/ifaddr.c (rsock_getifaddrs): fix possible memory leak.
When a system had no interface, this function used xmalloc for root
  but did not return any reference to it.  This patch fixes it by
  immediately returning an empty array if no interface is found.
  Coverity Scan found this bug.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-02 12:41:28 +00:00
nobu 85ab537999 file/stat.c: fix commit miss
* ext/-test-/file/stat.c: extension library to test [Feature #8050].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-01 11:57:02 +00:00
zzak e1bb07105f * ext/objspace/objspace.c: [DOC] Cleaned up many rdoc formatting
issues and several duplicate grammar bugs.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-30 14:15:41 +00:00
zzak 8073bd792c * ext/objspace/object_tracing.c: [DOC] Adjust rdoc formatting and fix
small grammar typo


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-30 14:02:31 +00:00
ko1 1d4e3d48c2 * ext/objspace/object_tracing.c: [DOC] add some nots for
ObjectSpace::trace_object_allocations.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-30 08:29:30 +00:00
ko1 1450e0b5ac * ext/objspace/object_tracing.c: add new 3 methods to control tracing.
* ObjectSpace::trace_object_allocations_start
* ObjectSpace::trace_object_allocations_stop
* ObjectSpace::trace_object_allocations_clear
  And some refactoring.
* test/objspace/test_objspace.rb: add a test for new methods.
* NEWS: add a description for new methods.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-30 08:17:30 +00:00
nobu 771c8ed338 parse.y: fix inconsistency with literals
* parse.y (rb_id_attrset): fix inconsistency with literals, allow
  ID_ATTRSET and return it itself, but ID_JUNK cannot make ID_ATTRSET.
  and raise a NameError instead of rb_bug() for invalid argument.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-29 13:56:33 +00:00
shugo 2328b4b29a * ext/curses/extconf.rb: check the size of chtype.
* ext/curses/curses.c (NUM2CH, CH2NUM): use proper macros for
  the size of chtype.

[ruby-core:56090] [Bug #8659]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-27 15:26:19 +00:00
zzak 8603fdcc62 * ext/bigdecimal/bigdecimal.c: [DOC] several fixes by @chastell
This includes fixing the capitalization of Infinity, return value of
  example "BigDecimal.new('NaN') == 0.0", and code style in example.
  [Fixes GH-398] https://github.com/ruby/ruby/pull/398


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-26 13:13:59 +00:00
zzak 017a975ec2 * ext/digest/digest.c: [DOC] typo in overview by @chastell
[Fixes GH-399] https://github.com/ruby/ruby/pull/399


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-26 13:04:27 +00:00
zzak 12fdf4bc92 * ext/openssl/ossl.c: [DOC] typo in example by @zoranzaric
[Fixes GH-401] https://github.com/ruby/ruby/pull/401


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-26 13:01:54 +00:00
nobu 360c66732c win32/registry.rb: size in bytes
* ext/win32/lib/win32/registry.rb (Win32::Registry#write): data size
  is in bytes, not chars.  terminators should be placed automatically.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-24 07:41:17 +00:00
nobu 79e880c90d win32/registry.rb: encode name
* ext/win32/lib/win32/registry.rb (Win32::Registry#each_value): encode
  name.
* ext/win32/lib/win32/registry.rb (Win32::Registry#each_key): ditto.
* ext/win32/lib/win32/registry.rb (Win32::Registry#export_string):
  encode to locale encoding if default internal is not set.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-24 07:39:41 +00:00
nobu 14695c4c1a win32/registry.rb: fix runtime errors
* ext/win32/lib/win32/registry.rb (Win32::Registry::API#EnumKey):
  size of the name is in WCHARs, not in bytes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-24 07:35:12 +00:00
nobu aaccbfeda1 win32/registry.rb: fix runtime errors
* ext/win32/lib/win32/registry.rb (Win32::Registry::API): need
  Constants.
* ext/win32/lib/win32/registry.rb (Win32::Registry::API#EnumValue):
  size of the name is in WCHARs, not in bytes

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-24 03:51:14 +00:00