aboutsummaryrefslogtreecommitdiffstats
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
* * properties.nobu2013-05-271-80/+80
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/objspace/gc_hook.c, ext/objspace/objspace.c: add new methods toko12013-05-272-0/+82
| | | | | | | | | | | | | | 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
* * vm_trace.c (rb_postponed_job_register_one): fix iteration bug.ko12013-05-271-0/+19
| | | | | | | | | * 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
* suppress warningsnobu2013-05-274-3/+6
| | | | | | | | | | | | | | | * 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
* * include/ruby/ruby.h, gc.c: add new internal eventko12013-05-271-1/+10
| | | | | | | | | | | | | | | | | | | 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
* * include/ruby/ruby.h: rename RUBY_INTERNAL_EVENT_FREE toko12013-05-272-3/+3
| | | | | | | | | | | 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
* * ext/objspace/objspace.c: support ObjectSpace.trace_object_allocations.ko12013-05-272-0/+200
| | | | | | | | | | | | | 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
* * include/ruby/ruby.h, gc.c, vm_trace.c: add internal events.ko12013-05-272-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | * 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
* * ext/-test-/postponed_job/postponed_job.c: fix `init' function name.ko12013-05-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/debug.h, vm_trace.c: add rb_postponed_job API.ko12013-05-262-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* * hash.c, include/ruby/ruby.h: support WB protected hash.ko12013-05-261-1/+1
| | | | | | | | | | | | * 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
* * ext/pty/pty.c (get_device_once): FreeBSD 10-current and 9-stablenaruse2013-05-251-2/+6
| | | | | | | | added O_CLOEXEC support to posix_openpt, so assume FreeBSD 9.2 or later supports it. http://www.freebsd.org/cgi/query-pr.cgi?pr=162374 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove unused variablenaruse2013-05-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/fiddle/fiddle.c: fix typo in fiddle doc [Bug #8412]charliesome2013-05-241-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/strscan/strscan.c (strscan_aref): raise error if givennaruse2013-05-241-3/+20
| | | | | | name reference is not found. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io/console: rdocnobu2013-05-242-0/+8
| | | | | | | | * ext/io/console/console.c (io_getch): add rdoc. * ext/io/console/lib/console/size.rb (IO.console_size): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rename generic io modulesnobu2013-05-242-3/+3
| | | | | | | * ext/io/console/console.c, ext/stringio/stringio.c: rename internally used modules as generic_readable and generic_writable. [Fix GH-315] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* extmk.rb: don't duplicatenobu2013-05-231-1/+3
| | | | | | * ext/extmk.rb (extract_makefile): do not add dldflags if duplicated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add a comment.akr2013-05-231-0/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/strscan/strscan.c (strscan_aref): support named captures.naruse2013-05-211-1/+34
| | | | | | patched by Konstantin Haase [ruby-core:54664] [Feature #8343] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/digest/lib/digest.rb (Digest::Class.file): Take optionalknu2013-05-211-2/+4
| | | | | | | arguments that are passed to the constructor of the digest class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/extmk.rb: nodoc this filezzak2013-05-201-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/stringio/stringio.c: Correct position of method rdoczzak2013-05-191-14/+17
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c: Formatting for BigMath [Fixes GH-306]zzak2013-05-192-26/+66
| | | | | | | | Based on a patch by @eLobato. * ext/bigdecimal/lib/bigdecimal/math.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos inspired by r40825kazu2013-05-194-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.nobu2013-05-194-16/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos. Patch by k_takata.ktsj2013-05-1926-63/+63
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/fiddle/extconf.rb: ignore rc version of libffi to fix build failure.ktsj2013-05-191-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb (INTEGER2NUM): Make less comparisons.akr2013-05-181-6/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb (INTEGER2NUM): Renamed from INTEGER2VALUE.akr2013-05-181-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb (INTEGER2VALUE): Suppress a warning:akr2013-05-181-2/+2
| | | | | | | | comparison between signed and unsigned integer expressions git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb (INTEGER2VALUE): Use LONG2FIX if possible.akr2013-05-181-2/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/mkconstants.rb: Convert integer constants bigger than intakr2013-05-171-13/+14
| | | | | | | | correctly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/ifaddr.c: Use unsigned LONG_LONG to represent flagsakr2013-05-171-4/+19
| | | | | | | | because SunOS 5.11 (OpenIndiana) defines ifa_flags as uint64_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Enable the document for Socket::Ifaddr#ifindex.akr2013-05-171-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix a dependency.akr2013-05-161-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/psych/lib/psych/visitors/yaml_tree.rb: fix syntax error.tenderlove2013-05-151-1/+1
| | | | | | Thanks @spastorino! [ruby-core:55011] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/depend: Add a dependency for ifaddr.o.akr2013-05-151-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* yaml_tree.rb: fix warning messagenobu2013-05-151-1/+1
| | | | | | | * ext/psych/lib/psych/visitors/yaml_tree.rb: fix warning message. Class.create does not exist. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/psych/lib/psych/visitors/yaml_tree.rb: only emit warnings whentenderlove2013-05-151-1/+3
| | | | | | -w is enabled. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/psych/lib/psych/visitors/yaml_tree.rb: adding backwardstenderlove2013-05-141-0/+7
| | | | | | compatible YAMLTree.new method git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/psych/lib/psych.rb: Adding Psych.safe_load for loading a usertenderlove2013-05-1413-54/+256
| | | | | | | | | | | | | | | | | | | | | | | | | defined, restricted subset of Ruby object types. * ext/psych/lib/psych/class_loader.rb: A class loader for encapsulating the logic for which objects are allowed to be deserialized. * ext/psych/lib/psych/deprecated.rb: Changes to use the class loader * ext/psych/lib/psych/exception.rb: ditto * ext/psych/lib/psych/json/stream.rb: ditto * ext/psych/lib/psych/nodes/node.rb: ditto * ext/psych/lib/psych/scalar_scanner.rb: ditto * ext/psych/lib/psych/stream.rb: ditto * ext/psych/lib/psych/streaming.rb: ditto * ext/psych/lib/psych/visitors/json_tree.rb: ditto * ext/psych/lib/psych/visitors/to_ruby.rb: ditto * ext/psych/lib/psych/visitors/yaml_tree.rb: ditto * ext/psych/psych_to_ruby.c: ditto * test/psych/helper.rb: ditto * test/psych/test_safe_load.rb: tests for restricted subset. * test/psych/test_scalar_scanner.rb: ditto * test/psych/visitors/test_to_ruby.rb: ditto * test/psych/visitors/test_yaml_tree.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* changing variable nametenderlove2013-05-141-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/.document: Add ifaddr.c.akr2013-05-141-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* socket: fix build error and warnings on mingwnobu2013-05-143-1/+25
| | | | | | | | | | | | * ext/socket/extconf.rb: check for if_nametoindex() for i686-w64-mingw32, and check for declarations of if_indextoname() and if_nametoindex(). * ext/socket/ifaddr.c (ifaddr_ifindex): not-implement unless if_nametoindex() is available. * ext/socket/rubysocket.h: declare if_indextoname() and if_nametoindex() if available but not declared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update doc.akr2013-05-141-18/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/dl/lib/dl/func.rb (DL::Function#call): check tainted whennagachika2013-05-142-0/+12
| | | | | | | | $SAFE > 0. * ext/fiddle/function.c (function_call): check tainted when $SAFE > 0. * test/fiddle/test_func.rb (module Fiddle): add test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/extconf.rb: Check socketpair again.akr2013-05-131-0/+1
| | | | | | | | It is required on Unix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * win32/win32.c, include/ruby/win32.h (getipaddrs): [experimental]usa2013-05-131-5/+0
| | | | | | | | | | | | | | | 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
* * include/ruby/ruby.h: constify RBasic::klass and addko12013-05-135-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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