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

1168 Коммитов

Автор SHA1 Сообщение Дата
normal 6dda4f17a9 socket: memoize common socket families in fptr->mode
This provides a minor speedup by avoiding an extra syscall

	require 'socket'
	require 'benchmark'
	nr = 100000
	msg = 'hello world'
	buf = ''
	size = msg.bytesize
	puts(Benchmark.measure do
	  UNIXSocket.pair(:SEQPACKET) do |a, b|
	    nr.times do
	      a.sendmsg_nonblock(msg, 0, exception: false)
	      b.recv(size, 0, buf)
	    end
	  end
	end)

             user     system      total        real
before:  0.330000   0.340000   0.670000 (  0.678235)
 after:  0.290000   0.240000   0.530000 (  0.534527)

* ext/socket/rubysocket.h: flags for common socket families
  (rsock_getfamily): update signature
* include/ruby/io.h: comment socket FMODE flags
* ext/socket/init.c (rsock_getfamily): memoize family
* ext/socket/basicsocket.c: adjust rsock_getfamily calls
* ext/socket/ancdata.c: ditto
  [ruby-core:69713] [Feature #11298]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02 01:58:14 +00:00
normal c31b0def42 st.c: use ccan linked-list (try 3)
This improves the bm_vm2_bighash benchmark significantly by
removing branches during insert, but slows down anything
requiring iteration with the more complex loop termination
checking.

Speedup ratio of 1.10 - 1.20 is typical for the vm2_bighash
benchmark.

v3 - st_head calculates list_head address in two steps
     to avoid a bug in old gcc 4.4 (Debian 4.4.7-2)
     bug which incorrectly warned with:
     warning: dereferencing pointer ‘({anonymous})’ does break
     strict-aliasing rules

* include/ruby/st.h (struct st_table): hide struct list_head
* st.c (struct st_table_entry): adjust struct
  (head, tail): remove shortcut macros
  (st_head): new wrapper function
  (st_init_table_with_size): adjust to new struct and API
  (st_clear): ditto
  (add_direct): ditto
  (unpack_entries): ditto
  (rehash): ditto
  (st_copy): ditto
  (remove_entry): ditto
  (st_shift): ditto
  (st_foreach_check): ditto
  (st_foreach): ditto
  (get_keys): ditto
  (get_values): ditto
  (st_values_check): ditto
  (st_reverse_foreach_check): ditto (unused)
  (st_reverse_foreach): ditto (unused)
  [ruby-core:69726] [Misc #10278]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-29 18:10:00 +00:00
normal b8d544832b Revert "st.c: use ccan linked-list (try 2)"
This reverts commit r51044
Still getting failure notices from ko1's CI machine.
ref: g3qkqn

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-26 22:52:26 +00:00
normal d3725a86de st.c: use ccan linked-list (try 2)
This improves the bm_vm2_bighash benchmark significantly by
removing branches during insert, but slows down anything
requiring iteration with the more complex loop termination
checking.

Speedup ratio of 1.10 - 1.20 is typical for the vm2_bighash
benchmark.

* include/ruby/st.h (struct st_table): hide struct list_head
* st.c (struct st_table_entry): adjust struct
  (head, tail): remove shortcut macros
  (st_head): new wrapper function
  (st_init_table_with_size): adjust to new struct and API
  (st_clear): ditto
  (add_direct): ditto
  (unpack_entries): ditto
  (rehash): ditto
  (st_copy): ditto
  (remove_entry): ditto
  (st_shift): ditto
  (st_foreach_check): ditto
  (st_foreach): ditto
  (get_keys): ditto
  (get_values): ditto
  (st_values_check): ditto
  (st_reverse_foreach_check): ditto (unused)
  (st_reverse_foreach): ditto (unused)
  [ruby-core:69726] [Misc #10278]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-26 22:32:06 +00:00
normal cc5547a4ad Revert r51034 "st.c: use ccan linked-list"
Maybe this will stop mysterious CI failures from ko1@sasada-8core:

リビジョン 51034 です。
make[1]: ディレクトリ `/mnt/sdb1/ruby/build' に入ります
../trunk/revision.h unchanged
make[1]: ディレクトリ `/mnt/sdb1/ruby/build' から出ます
make[1]: ディレクトリ `/mnt/sdb1/ruby/build' に入ります
config.guess already exists
config.sub already exists
generating ../trunk/ext/ripper/ripper.c
make[2]: ディレクトリ `/mnt/sdb1/ruby/trunk/ext/ripper' に入ります
extracting ripper.y from ../../parse.y
id.h not found in ["../.."]
make[2]: *** [ripper.y] エラー 1
make[2]: ディレクトリ `/mnt/sdb1/ruby/trunk/ext/ripper' から出ます
make[1]: *** [../trunk/ext/ripper/ripper.c] エラー 2
make[1]: ディレクトリ `/mnt/sdb1/ruby/build' から出ます
make: [up] エラー 2 (無視されました)
make: *** [.rbconfig.time] セグメンテーション違反です
Command exited with non-zero status 2

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-25 19:56:20 +00:00
normal d8748874cc st.c: use ccan linked-list
This improves the bm_vm2_bighash benchmark significantly by
removing branches during insert, but slows down anything
requiring iteration with the more complex loop termination
checking.

Speedup ratio of 1.10 - 1.20 is typical for the vm2_bighash
benchmark.

* include/ruby/st.h (struct st_table): hide struct list_head
* st.c (struct st_table_entry): adjust struct
  (head, tail): remove shortcut macros
  (st_head): new wrapper function
  (st_init_table_with_size): adjust to new struct and API
  (st_clear): ditto
  (add_direct): ditto
  (unpack_entries): ditto
  (rehash): ditto
  (st_copy): ditto
  (remove_entry): ditto
  (st_shift): ditto
  (st_foreach_check): ditto
  (st_foreach): ditto
  (get_keys): ditto
  (get_values): ditto
  (st_values_check): ditto
  (st_reverse_foreach_check): ditto (unused)
  (st_reverse_foreach): ditto (unused)
  [ruby-core:69726] [Misc #10278]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-25 19:01:25 +00:00
nobu ca87ac691b intern.h: rb_strlen_lit
* include/ruby/intern.h (rb_strlen_lit): new macro to get the
  length of a string literal, borrowed from mruby/mruby@e4afd53.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-24 03:47:10 +00:00
nobu a9b06707d9 $SAFE=2 is now obsolete
* include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): fix safe_level
  limit.

* vm_core.h (rb_proc_t): update comment for safe_level.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-18 14:33:12 +00:00
hsbt 5d6ca9e950 * include/ruby/ruby.h: $SAFE=2 is now obsolete.
* dir.c, ext/fiddle/handle.c, ext/socket/basicsocket.c, file.c
  gc.c, io.c, process.c, safe.c, signal.c, win32/file.c:
  removed code for $SAFE=2
* test/erb/test_erb.rb, test/fiddle/test_handle.rb
  test/ruby/test_env.rb: removed tests for $SAFE=2.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-18 14:21:03 +00:00
hsbt bbf440c90b * include/ruby/ruby.h: $SAFE=3 is now obsolete.
* ext/socket/init.c, ext/socket/socket.c, ext/socket/tcpsocket.c
  ext/socket/udpsocket.c, gc.c, object.c, re.c, safe.c: removed code
  for $SAFE=3
* bootstraptest/test_method.rb, test/erb/test_erb.rb, test/ruby/test_dir.rb
  test/ruby/test_file.rb, test/ruby/test_method.rb, test/ruby/test_regexp.rb
  test/ruby/test_thread.rb: remove tests for $SAFE=3

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-17 05:29:51 +00:00
usa 2bc2802096 * file.c (File::SHARE_DELETE): new flag to be able to delete opened file
on Windows.

* include/win32/win32.c (O_SHARE_DELETE): new pseudo file mode flag.

* win32/win32.c (rb_w32_{w,}open): support above flag.  [EXPERIMENTAL]

* NEWS: mention about this feature.
  [Feature #11218] [ruby-dev:49022]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-12 12:14:06 +00:00
hsbt 0eb195cee3 * ext/win32ole/win32ole.c: fix a typo. Patch by @davydovanton
[fix GH-923]
* include/ruby/st.h: ditto.
* include/ruby/util.h: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-04 02:53:11 +00:00
normal f6cd582505 variable.c: avoid compatibility table with generic ivars
This recovers and improves performance of Marshal.dump/load on
Time objects compared to when we implemented generic ivars
entirely using st_table.

This also recovers some performance on other generic ivar objects,
but does not bring bring Marshal.dump/load performance up to
previous speeds.

benchmark results:
minimum results in each 10 measurements.
Execution time (sec)
		name    trunk   geniv   after
marshal_dump_flo        0.343   0.334   0.335
marshal_dump_load_geniv 0.487   0.527   0.495
marshal_dump_load_time  1.262   1.401   1.257

Speedup ratio: compare with the result of `trunk' (greater is better)
		name    geniv   after
marshal_dump_flo        1.026   1.023
marshal_dump_load_geniv 0.925   0.985
marshal_dump_load_time  0.901   1.004

* include/ruby/intern.h (rb_generic_ivar_table): deprecate
* internal.h (rb_attr_delete): declare
* marshal.c (has_ivars): use rb_ivar_foreach
  (w_ivar): ditto
  (w_object): update for new interface
* time.c (time_mload): use rb_attr_delete
* variable.c (generic_ivar_delete): implement
  (rb_ivar_delete): ditto
  (rb_attr_delete): ditto
  [ruby-core:69323] [Feature #11170]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-30 00:20:15 +00:00
kazu d5a93ed109 fix condition
* include/ruby/defines.h (RUBY_ATTR_ALLOC_SIZE): fix condition.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-26 12:37:42 +00:00
nobu 3a08b7e204 intern.h: move rb_sym_all_symbols
* include/ruby/intern.h (rb_sym_count): move `rb_sym_all_symbols`
  to a symbol.c specific section.  a part of patch by Lourens
  Naudé.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-22 12:13:14 +00:00
nobu fdb957925f ruby.h: warn old names
* include/ruby/ruby.h (rb_data_typed_object_alloc),
  (rb_data_object_alloc): warn use of old names.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-20 05:09:00 +00:00
nobu 68426106a9 ruby.h: DEPRECATED_BY
* include/ruby/ruby.h (DEPRECATED_BY): fallback definition without
  additional messages.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-20 04:21:08 +00:00
nobu 1443776cc9 ruby.h: add old names
* include/ruby/ruby.h (rb_data_typed_object_alloc),
  (rb_data_object_alloc): add old names for source level backward
  compatibilities.
* gc.c (rb_data_object_alloc, rb_data_typed_object_alloc): add
  aliases for binary level backward compatibilities.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-19 02:18:49 +00:00
nobu 11c8b83ab6 ruby.h: cast for C++
* include/ruby/ruby.h (Data_Make_Struct0): needs function pointer
  casts to fix function overloading in C++.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-19 00:54:46 +00:00
nobu 356baf95db ruby.h: cast for C++
* include/ruby/ruby.h (Data_Make_Struct0, TypedData_Make_Struct0):
  explicit cast from void* is necessary as implicit cast is
  disallowed in C++.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-19 00:43:58 +00:00
nobu c4d216793b intern.h: rb_f_notimplement for ext on Windows
* include/ruby/intern.h (rb_f_notimplement): should not respond to
  not-implemented methods.  as the address inside a DLL and the
  imported address are different on Windows, use an exported
  variable to share the same address.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-18 06:31:42 +00:00
nobu ecbad6dfa8 gc.c: rename alloc as wrap
* gc.c (rb_data_object_wrap, rb_data_typed_object_wrap): rename
  alloc as wrap.  these functions do not allocate data pointers
  but just wrap the given pointers.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-16 12:17:14 +00:00
nobu 3f29f5205c ruby.h: suppress warnings
* include/ruby/ruby.h (Data_Make_Struct, TypedData_Make_Struct):
  make statement-expression to get rid of strict-aliasing warnings
  by old GCC.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-11 00:41:11 +00:00
nobu 482bf1959a ruby.h: fix possible memory leak
* include/ruby/ruby.h (Data_Make_Struct, TypedData_Make_Struct):
  allocate wrapper data object before allocating DATA_PTR to get
  rid of possible memory leak when the former failed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-10 15:20:35 +00:00
usa c15a74f3d0 * win32/win32.c (rb_w32_{getc,putc}): removed. they are needed for old
ruby (before 1.8), but not now.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-24 01:44:12 +00:00
naruse 7bf5ba1b49 * win32/win32.c: remove bcc related code.
* include/ruby/win32.h: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-23 23:41:16 +00:00
nobu a4d2997263 intern.h: stale declarations
* include/ruby/intern.h: remove stale declarations, which were
  removed because of ripper.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-07 02:44:00 +00:00
nobu c57932f782 win32.c: readlink
* win32/win32.c (wreadlink, rb_w32_ureadlink): implement readlink().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-23 08:36:04 +00:00
nobu f5b96e594c win32.c: w32_lstati64
* win32/win32.c (winnt_stat): stat with following symbolic links.
* win32/win32.c (winnt_lstat): rename old winnt_stat, which does
  not follow symbolic links.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-23 05:40:48 +00:00
nobu 5155a402ab win32.c: S_IFLNK
* win32/win32.c (fileattr_to_unixmode): set symlink for reparse
  points.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-19 02:38:02 +00:00
ko1 0db407836b * include/ruby/ruby.h: use rb_gc_writebrrier() simply.
For incremental GC, we need to get a pointer to the objspace.
  We can share this pointer for the following WB process.
  And considering icache hit ratio, prcess in the GC.
* gc.c (rb_gc_writebarrier): added.
* gc.c (gc_writebarrier_generational, gc_writebarrier_incremental):
  make them NOINLINE because inlining them into rb_gc_writebarrier()
  makes a prologue code of rb_gc_writebarrier() longer (storing callee
  save registers).
  This patch improve the performance of WB on micro-benchmarks.
  name                   ruby 2.1   trunk   modified
  vm1_gc_wb_ary*            0.511   0.632      0.532
  vm1_gc_wb_ary_promoted*   0.578   0.701      0.674
  vm1_gc_wb_obj*            0.419   0.575      0.492
  vm1_gc_wb_obj_promoted*   0.537   0.664      0.618
                                                 (sec)



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-17 10:26:39 +00:00
nobu c7988fd29d ruby.h: suppress false warnings
* include/ruby/ruby.h (rb_data_object_alloc_warning): enable only
  if __builtin_choose_expr works with __builtin_constant_p so that
  warnings will be suppressed if klass is 0.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-16 07:49:27 +00:00
ko1 0952b43b9b * include/ruby/ruby.h: introduce new type T_IMEMO.
T_IMEMO is Internal Memo type, internal use only.
  T_IMEMO has same purpose of NODE_MEMO.
  To insert T_IMEMO, type numbers are modified a little.
* internal.h: define struct RIMemo. Each RIMemo objects
  has imemo_type. We can observe it by the imemo_type() function.
* gc.c (rb_imemo_new): added.
* node.h: remove NODE_CREF and NEW_CREF().
* node.c (rb_gc_mark_node): ditto.
* vm.c (vm_cref_new): use rb_imem_new().
* vm_eval.c: ditto.
* vm_eval.c (eval_string_with_cref):
* vm_eval.c (rb_type_str):
* vm_insnhelper.c: use RIMemo objects for CREF.
* ext/objspace/objspace.c: support T_IMEMO.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11 10:36:17 +00:00
ko1 8f88ff4e37 * internal.h: remove struct method_table_wrapper.
struct method_table_wrapper was introduced to avoid duplicate marking
  for method tables.
  For example, `module M1; def foo; end; end` make one method table
  (mtbl) contains a method `foo`. M1 (T_MODULE) points mtbl.
  Classes C1 and C2 includes M1, then two T_ICLASS objects are created
  and they points mtbl too. In this case, three objects (one T_MODULE
  and two T_ICLASS objects) points same mtbl. On marking phase, these
  three objects mark same mtbl. To avoid such duplication, struct
  method_table_wrapper was introduced.
  However, created two T_ICLASS objects have same or shorter lifetime
  than M1 (T_MODULE) object. So that we only need to mark mtbl from M1,
  not from T_ICLASS objects. This patch tries marking only from M1.
  Note that one `Module#prepend` call creates two T_ICLASS objects.
  One for refering to a prepending Module object, same as
  `Module#include`. We don't nedd to care this T_ICLASS.
  One for moving original mtbl from a prepending class. We need to
  mark such mtbl from this T_ICLASS object. To mark the mtbl,
  we need to use `RCLASS_ORIGIN(klass)` on marking from a prepended
  class `klass`.
* class.c: ditto.
* eval.c (rb_using_refinement): ditto.
* gc.c: ditto.
* include/ruby/ruby.h: define m_tbl directly. The definition of
  struct RClass should be moved to (srcdir)/internal.h.
* method.h: remove decl of rb_free_m_tbl_wrapper().
* object.c: use RCLASS_M_TBL() directly.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-05 22:20:14 +00:00
nobu e396ba84fb intern.h: rb_str_new_literal
* include/ruby/intern.h (rb_str_new_literal): define on all
  platforms, not only gcc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-03 10:52:14 +00:00
nobu 903655ac70 ruby/version.h: bump API version
* include/ruby/version.h: bump API version too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-29 11:16:17 +00:00
nobu 01195a202c ruby.h: parent in rb_data_type_t
* ruby.h (rb_data_type_t): revert r48647 and revise parent member.
  [ruby-core:66969] [Bug #10621]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-24 03:16:31 +00:00
nobu 0618ea7590 ruby.h: get rid of C++ warnings
* include/ruby/ruby.h (PRIsVALUE): put a space after string
  literals not to be confused with C++11 string literal suffix.
  https://github.com/ruby/ruby/commit/a9f3eb7#commitcomment-9040169

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-19 11:00:22 +00:00
ko1 1b6aa03eb9 * class.c (class_alloc): Strat from age == 2.
Class and Module objects can be living long life.
* iseq.c: Same for ISeq objects.
* gc.c (RVALUE_AGE_RESET): added.
* gc.c (newobj_of): allow to generate (age != 0) objects.
* gc.c (rb_copy_wb_protected_attribute): reset age for wb unprotected
  objects.
* include/ruby/ruby.h: add RUBY_TYPED_PROMOTED1 as an unrecommended
  flag.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-11 10:15:30 +00:00
nobu aaed10716a intern.h: SIZED_ENUMERATOR
* include/ruby/intern.h (SIZED_ENUMERATOR): separate from
  RETURN_SIZED_ENUMERATOR.

* string.c (rb_str_enumerate_chars): get rid of calling
  rb_block_given_p() twice.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-03 03:25:12 +00:00
nobu c95b3a16bd ruby.h: no warnings of hidden objects
* include/ruby/ruby.h (rb_data_object_alloc_warning): no warnings
  of internal hidden objects which klass == 0.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-03 03:25:06 +00:00
nobu 012c558127 re.c: rb_reg_region_copy
* re.c (rb_reg_region_copy): new function to try with GC if copy
  failed and return the error.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-01 21:30:58 +00:00
nobu 544d28c300 ruby.h: no parent in rb_data_type_t
* error.c (rb_typeddata_is_kind_of, rb_check_typeddata): ditto.
* error.c (rb_typeddata_inherited_p): deprecate. still keep for
  potential binary compatibility.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-29 07:14:53 +00:00
nobu c262acb4e0 ruby.h: export keyword argument functions
* include/ruby/ruby.h (rb_get_kwargs, rb_extract_keywords): export
  keyword argument functions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-26 13:28:15 +00:00
akr 8463a90871 * include/ruby/io.h (FMODE_WSPLIT): Removed. The write() system call
is not required to split.  It was useful to avoid whole process
  blocking in Ruby 1.8 but not useful since write() is invoked without
  GVL.
  (FMODE_WSPLIT_INITIALIZED): Ditto.

* io.c (wsplit_p): Removed.
  (io_writable_length): Removed.
  (rb_fcntl): Don't update the removed flags.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-18 09:10:59 +00:00
nobu de870875f7 vm_eval.c: rb_current_receiver
* vm_eval.c (rb_current_receiver): new function to return the
  receiver in the current control frame.  [Feature #10195]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-16 10:38:15 +00:00
usa fd9f6bde95 * win32/win32.c, include/win32/win32.h (rb_w32_set_nonblock): new
function to support nonblock-mode of pipes.

* win32/win32.c (rb_w32_read): nonblock-mode pipe returns ERROR_NO_DATA
  if there is no data, but also returns it if remote-end is closed.

* win32/win32.c (rb_w32_write): if cannot to write any data, it may be
  blocking.

* io.c (rb_io_set_nonblock): use rb_w32_set_nonblock for Windows.

* ext/io/nonblock/nonblock.c (rb_io_nonblock_set): use ruby's API when
  setting nonblock-mode.

* test/ruby/test_io.rb: test nonblock pipes on Windows.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-10 10:42:19 +00:00
nobu 4b8cb23a36 intern.h: deprecate disable and enable super
* include/ruby/intern.h (rb_disable_super, rb_enable_super): warn
  as deprecated at build time, instead of ignoring silently or
  warning at runtime only.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-05 08:20:31 +00:00
nobu 9bc469b950 intern.h: deprecate rb_clear_cache
* include/ruby/intern.h (rb_clear_cache): mark as deprecated, not
  only warnings at runtime.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-05 07:27:02 +00:00
nobu a9f3eb75de ruby.h: add mark to PRIsVALUE
* include/ruby/ruby.h (PRIsVALUE), vsnprintf.c (BSD_vfprintf): add
  RUBY_PRI_VALUE_MARK to reduce danger of accidental conflict with
  plain "%i".  binary incompatible with extension libraries using
  PRIsVALUE and built for 2.1 and earlier.  [EXPERIMENTAL]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-04 03:51:33 +00:00