summaryrefslogtreecommitdiff
path: root/ext/objspace
AgeCommit message (Collapse)Author
2017-08-14Fix a class of a returned valueyui-knk
* ext/objspace/object_tracing.c (allocation_sourceline): Fix a class of a returned value. allocation_sourceline returns an integer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-22ruby tool/update-deps --fixshyouhei
Onigumo 6 (r57045) introduced new onigumo.h header file, which is required from quite much everywhere. This commit adds necessary dependencies. Note: ruby/oniguruma.h now includes onigumo.h, ruby/io.h includes oniguruma.h, ruby/encoding.h also includes oniguruma.h, and internal.h includes encoding.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-12ext/objspace: Specify frozen_string_literal: true.kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-31Add IMEMO type to heap dump output.tenderlove
IMEMO objects have many types. Without this change, we cannot see what types of IMEMO objects are being used when dumping the heap. Adding the type to the IMEMO object will allow us to gather statistics about IMEMO objects being used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-03Add `full` option to `ObjectSpace.dump_all`tenderlove
The `full` option includes all slots (even `T_NONE`) in the JSON output. This is to help with debugging heap fragmentation. Here is an example usage: ```ruby File.open('heap.json', 'w') do |f| ObjectSpace.dump_all(output: f, full: true) end ``` The `heap.json` file contains all slots, including empty slots. [Feature #13001] [ruby-core:78468] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-18objspace.c:: indent [ci skip]yui-knk
* ext/objspace/objspace.c (memsize_of_m): adjust indent of comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-28internal.h: RB_OBJ_BUILTIN_TYPEnobu
* internal.h (RB_OBJ_BUILTIN_TYPE): special-const safe BUILTIN_TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-26[DOC] replace Fixnum with Integer [ci skip]nobu
* numeric.c: [DOC] update document for Integer class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-17objspace_dump.c: dc is no longer used [ci skip]nobu
* ext/objspace/objspace_dump.c (heap_i): remove no longer used variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-16Use JSON lines format for full heap dumps.tenderlove
This commit changes full heap dumps back to using JSON lines format (http://jsonlines.org) so that we can process very large heaps without loading the entire heap in to memory at once. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-13Use PRIuSIZE format specifier for size_t valuesrhe
Use PRIuSIZE instead of PRIdSIZE. This fixes the exception message shown on too large xmalloc2. This commit also fixes other incorrect use of PRIdSIZE in other functions; though most of them are debug print. * gc.c (heap_extend_pages, get_envparam_size, ruby_malloc_size_overflow, gc_profile_dump_on): Use PRIuSIZE instead of PRIdSIZE as the passed value is size_t, not ssize_t. * iseq.c (get_line_info, rb_iseq_disasm_insn): Ditto. * sprintf.c (rb_str_format): Ditto. * thread_win32.c (native_thread_create): Ditto. * vm.c (get_param): Ditto. * ext/objspace/objspace_dump.c (dump_append_string_content, dump_object): Ditto. * ext/socket/raddrinfo.c (host_str, port_str): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-11ObjectSpace.dump_all: valid JSONnobu
* ext/objspace/objspace_dump.c: generate valid JSON for dump_all. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-08objspace_dump.c: fix formatnobu
* ext/objspace/objspace_dump.c (dump_append_string_content), (dump_object): fix the format specifiers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-08* configure.in: add -Wsuggest-attribute=format and suppress warnings.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-22* variable.c: use uint32_t instead of long to avoid confusion aboutnaruse
the type of ivtbl->numiv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-11Update dependencies.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-22vm_core.h: use RUBY_ASSERTnobu
* vm_core.h (VM_ASSERT): use RUBY_ASSERT instead of rb_bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16handle ext/ as r53141naruse
g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&# frozen_string_literal: false\n");f.rewind;f.write s}}' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-19objspace_dump.c: special constnobu
* ext/objspace/objspace_dump.c: support special constant objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-17* ext/objspace/objspace_dump.c (obj_type): add IMEMO types to the heaptenderlove
dump information. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-21* ext/objspace/objspace.c: add a new method ObjectSpace.count_symbols.ko1
[Feature #11158] * symbol.c (rb_sym_immortal_count): added to count immortal symbols. * symbol.h: ditto. * test/objspace/test_objspace.rb: add a test for this method. * NEWS: describe about this method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-10objspace.c: use rb_ident_hash_newnobu
* ext/objspace/objspace.c (reachable_objects_from_root): use rb_ident_hash_new instead of funcall Hash#compare_by_id. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-21* make rb_iseq_t T_IMEMO object (type is imemo_iseq).ko1
All contents of previous rb_iseq_t is in rb_iseq_t::body. Remove rb_iseq_t::self because rb_iseq_t is an object. RubyVM::InstructionSequence is wrapper object points T_IMEMO/iseq. So RubyVM::ISeq.of(something) method returns different wrapper objects but they point the same T_IMEMO/iseq object. This patch is big, but most of difference is replacement of iseq->xxx to iseq->body->xxx. (previous) rb_iseq_t::compile_data is also located to rb_iseq_t::compile_data. It was moved from rb_iseq_body::compile_data. Now rb_iseq_t has empty two pointers. I will split rb_iseq_body data into static data and dynamic data. * compile.c: rename some functions/macros. Now, we don't need to separate iseq and iseqval (only VALUE). * eval.c (ruby_exec_internal): `n' is rb_iseq_t (T_IMEMO/iseq). * ext/objspace/objspace.c (count_imemo_objects): count T_IMEMO/iseq. * gc.c: check T_IMEMO/iseq. * internal.h: add imemo_type::imemo_iseq. * iseq.c: define RubyVM::InstructionSequnce as T_OBJECT. Methods are implemented by functions named iseqw_.... * load.c (rb_load_internal0): rb_iseq_new_top() returns rb_iseq_t (T_IMEMO/iesq). * method.h (rb_add_method_iseq): accept rb_iseq_t (T_IMEMO/iseq). * vm_core.h (GetISeqPtr): removed because it is not T_DATA now. * vm_core.h (struct rb_iseq_body): remove padding for [Bug #10037][ruby-core:63721]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-21* ext/objspace/objspace.c (total_i): no need to skip singleton classes.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-21ext/objspace/objspace_dump.c: adjust indentnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-20* ext/objspace/objspace_dump.c(dump_object): Return empty JSON object whensorah
passed object is a special const, instead of SEGV. Based patch by Kohei Suzuki (eagletmt). [ruby-core:69692] [Bug #11291] * test/objspace/test_objspace.rb(test_dump_special_consts): Test for above fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-18* ext/objspace/objspace.c (count_imemo_objects): support imemo_ment.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-28* ext/objspace/objspace.c: add two methods to debug internals.ko1
* ObjectSpace.internal_class_of: return RBASIC_CLASS(obj). * ObjectSpace.internal_super_of: return RCLASS_SUPER(cls). * NEWS: add information about both methods. * test/objspace/test_objspace.rb: add tests for both methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-16gc.c: rename alloc as wrapnobu
* 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-04-10* ext/objspace/objspace.c: add ObjectSpace.count_imemo_objects methodko1
to count imemo objects for each type. * test/objspace/test_objspace.rb: add a test. * NEWS: describe about this addition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-10* ext/objspace/objspace.c (setup_hash): unify common routine.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11* internal.h: use T_IMEMO to represent `struct MEMO' value.ko1
memo->v1 and memo->v2 is WB protected values. So use MEMO_V1/V2_SET() macros to set these values. memo->u3 is ambiguous (sometimes a VALUE, sometimes an integer value), so use gc_mark_maybe() in gc.c to mark it. Rename NEW_MEMO() to MEMO_NEW(). Move MEMO_FOR and NEW_MEMO_FOF macros from node.h. Export a rb_imemo_new() function for ext/ripper. * node.h: remove NODE_MEMO. * enum.c: catch up these change. * enumerator.c: ditto. * load.c: ditto. * ext/objspace/objspace.c (count_nodes): ditto. * gc.c (gc_mark_children): mark imemo_memo type. * parse.y (new_args_gen): use T_IMEMO. (I'm not sure it is working correctly...) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11* node.h: remove NODE_IFUNC, NEW_IFUNC.ko1
* internal.h: use T_IMEMO for IFUNC. rename `struct IFUNC' to `struct vm_ifunc' and move the definition from vm_insnhelper.h. Add imemo_ifunc. * gc.c (gc_mark_children): mark imemo_ifunc type T_IMEMO object. * compile.c: catch up these changes. * proc.c: ditto. * vm_core.h (RUBY_VM_IFUNC_P): ditto. * vm_eval.c (rb_iterate): ditto. * vm_insnhelper.c: ditto. * ext/objspace/objspace.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-11* include/ruby/ruby.h: introduce new type T_IMEMO.ko1
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
2014-12-19Update dependencies.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-15* ext/objspace/objspace.c: ObjectSpace.memsize_of(obj) returnsko1
with sizeof(RVALUE). [Bug #8984] * gc.c (obj_memsize_of): ditto. * NEWS: add a NEWS entry. * test/objspace/test_objspace.rb: catch up this fix. * test/ruby/test_file_exhaustive.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-01use 0 for reservednobu
use 0 for rb_data_type_t::reserved instead of NULL, since its type may be changed in the future and possibly not a pointer type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-21Update dependency.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-21* tool/update-deps (in_makefile): Use FILES_NEED_VPATH andakr
FILES_CONFUSING. * ext/objspace/extconf.rb: Add VPATH for id.h git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-18Dependencies updated.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15* internal.h: Include ruby.h and ruby/encoding.h to beakr
includable without prior inclusion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15Mark auogenerated part.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15* common.mk: Remove comments in Dependency lines.akr
Notified by usa. * enc/depend: Ditto. * ext/**/depend: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15* tool/update-deps: Extend to fix dependencies.akr
* common.mk: Dependencies updated by tool/update-deps. * enc/depend: Ditto. * ext/**/depend: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-03ext: get rid of inadvertent ID creationnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-26 * ext/objspace/objspace_dump.c (dump_append): avoid fflush.shyouhei
because dump_append_string_value() iterates over each chars, fflush()-ing here effectively issues system calls on every single bytes exist in a ruby process. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-10ext/objspace: Check fptr before trying to dump FILE object fdcharliesome
Patch by Scott Francis. Closes GH-562. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05* ext/objspace/objspace_dump.c (dump_object): use STR_SHARED_P()ko1
instead of removed STR_NOCAPA_P() macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-04* string.c: remvoe STR_ASSOC related code.ko1
By r44804, string objects can not have STR_ASSOC flag. * internal.h: ditto. * ext/objspace/objspace_dump.c (dump_object): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-17* ext/objspace/object_tracing.c: Fix typo in a variable namea_matsuda
s/registerd/registered/ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e