summaryrefslogtreecommitdiff
path: root/ext/objspace
AgeCommit message (Collapse)Author
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
2013-12-16* ext/objspace/objspace.c (reachable_object_from_root_i): useko1
compare_by_identity hash to avoid hash modify problem during iteration. [Bug #9252] * ext/objspace/objspace.c (reachable_objects_from_root): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-15* ext/objspace/objspace.c (reachable_object_from_root_i):ko1
reachable objects should not include categories and category_objects because it is noisy information. In fact, objects created after calling ObjectSpace.reachable_objects_from_root should not be included as a returning hash objects. Currently, mswin64 platform has a problem because of this behaviour. Should we trace new objects? git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-10objspace_dump.c: include object's gc flags in dumptmm1
* ext/objspace/objspace_dump.c (dump_object): include fstring flag on strings. include gc flags (old, remembered, wb_protected) on all objects. * ext/objspace/objspace_dump.c (Init_objspace_dump): initialize lazy IDs before first use. * gc.c (rb_obj_gc_flags): new function to retrieve object flags * internal.h (RB_OBJ_GC_FLAGS_MAX): maximum flags allowed for one obj * test/objspace/test_objspace.rb (test_dump_flags): test for above * test/objspace/test_objspace.rb (test_trace_object_allocations): resolve name before dump (for rb_class_path_cached) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-09object_tracing.c: fix allocation from NEWOBJ hooknobu
* ext/objspace/object_tracing.c (newobj_i): use cached class path only to get rid object allocation during NEWOBJ hook. [ruby-core:58853] [Bug #9212] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-05ext/objspace: remove OS.after_gc_start_hook= and move internal testtmm1
* ext/objspace/gc_hook.c: remove this file * ext/-test-/tracepoint/gc_hook.c: new filename for above * ext/objspace/objspace.c: remove ObjectSpace.after_gc_start_hook= * test/objspace/test_objspace.rb: remove test * test/-ext-/tracepoint/test_tracepoint.rb: add above test for tracepoint re-entry git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-05gc.c: split GC_END event into GC_END_MARK and GC_END_SWEEPtmm1
* include/ruby/ruby.h: remove INTERNAL_EVENT_GC_END and replace with two new events: GC_END_MARK and GC_END_SWEEP * gc.c (gc_after_sweep): emit GC_END_SWEEP after lazy sweep is done * gc.c (gc_marks_body): emit GC_END_MARK at end of minor/major mark * ext/-test-/tracepoint/tracepoint.c (struct tracepoint_track): tests for new events. * test/-ext-/tracepoint/test_tracepoint.rb (class TestTracepointObj): ditto. * NEWS: remove ObjectSpace.after_gc_*_hook. These are only a sample, and will be removed before ruby 2.1. * ext/objspace/gc_hook.c: remove ObjectSpace.after_gc_end_hook= git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-26* ext/objspace/object_tracing.c (newobj_i): skip class_path if classko1
is frozen. rb_class_path() can modify frozen classes (and causes errors). This patch is temporary. We need no-modification/no-allocation class path function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-26* ext/objspace/objspace_dump.c (dump_append_string_value): Escapetmm1
control characters for strict json parsers. * ext/objspace/objspace_dump.c (objspace_dump): Document File/IO output option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-25* NEWS: Add ObjectSpace.after_gc_{start,end}_hook=tmm1
* ext/objspace/objspace_dump.c: [DOC] catch up dump/dump_all to r43679 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-24* ext/objspace/objspace_dump.c: test fixes and win32 compatibilitytmm1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-14objspace_dump.c: refine outputnobu
* ext/objspace/objspace_dump.c (dump_output): allow IO object as output, and use Tempfile.create and return open file instead of mkstemp() and path name for :file output. [ruby-core:58266] [Bug #9102] * test/objspace/test_objspace.rb (TestObjSpace#dump_my_heap_please): remove temporary output file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-11* internal.h: move common string/hash flags to include file.tmm1
* ext/objspace/objspace_dump.c: remove flags shared above. * hash.c: ditto. * string.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09objspace_dump.c: fix declarationnobu
* ext/objspace/objspace_dump.c (dump_output): fix declaration, mkstemp() needs a writable buffer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09* ext/objspace/object_tracing.c: use declarations in internal.h.nari
* ext/objspace/objspace.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09objspace_dump.c: fix portability issuenobu
* ext/objspace/objspace_dump.c (dump_output): fix portability issue. mkstemp() may not be available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09objspace_dump.c: extract output option utilitiesnobu
* ext/objspace/objspace_dump.c (dump_output, dump_result): extract output option utility functions from objspace_dump() and objspace_dump_all(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09objspace_dump.c: suppress warningsnobu
* ext/objspace/objspace_dump.c (dump_object): remove unused variables, and cast size_t to long. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09objspace_dump.c: indentnobu
* ext/objspace/objspace_dump.c: adjust indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-08* ext/objspace/object_tracing.c: Add experimental methods to dumptmm1
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-07* ext/objspace/object_tracing.c: [DOC] trace_object_allocations_stopzzak
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-05* gc.c: add support to estimate increase of oldspace memory usage.ko1
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-10-29* add RUBY_TYPED_FREE_IMMEDIATELY to data types which only useko1
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-28* common.mk, ext/objspace/depend, ext/coverage/depend,akr
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-17* ext/objspace/object_tracing.c (newobj_i): fix memory leak.ko1
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-16* ext/objspace/object_tracing.c (newobj_i): add workaround.ko1
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* ext/objspace/object_tracing.c: add new methodko1
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* ext/objspace/objspace.c: add a new method `reachable_objects_from_root'.ko1
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-11* ext/objspace/gc_hook.c: prohibit reentrant.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-30* ext/objspace/objspace.c: [DOC] Cleaned up many rdoc formattingzzak
issues and several duplicate grammar bugs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e