1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
zzak 2013-09-30 14:15:41 +00:00
parent bbf366bad8
commit e1bb07105f
2 changed files with 62 additions and 55 deletions

View file

@ -1,3 +1,8 @@
Mon Sep 30 23:14:36 2013 Zachary Scott <e@zzak.io>
* ext/objspace/objspace.c: [DOC] Cleaned up many rdoc formatting
issues and several duplicate grammar bugs.
Mon Sep 30 23:01:01 2013 Zachary Scott <e@zzak.io> Mon Sep 30 23:01:01 2013 Zachary Scott <e@zzak.io>
* ext/objspace/object_tracing.c: [DOC] Adjust rdoc formatting and fix * ext/objspace/object_tracing.c: [DOC] Adjust rdoc formatting and fix

View file

@ -5,7 +5,7 @@
$Author$ $Author$
created at: Wed Jun 17 07:39:17 2009 created at: Wed Jun 17 07:39:17 2009
NOTE: This extension library is not expected to exist except C Ruby. NOTE: This extension library is only expected to exist with C Ruby.
All the files in this distribution are covered under the Ruby's All the files in this distribution are covered under the Ruby's
license (see the file COPYING). license (see the file COPYING).
@ -150,11 +150,11 @@ memsize_of(VALUE obj)
* *
* Return consuming memory size of obj. * Return consuming memory size of obj.
* *
* Note that the return size is incomplete. You need to deal with * Note that the return size is incomplete. You need to deal with this
* this information as only a *HINT*. Especially, the size of * information as only a *HINT*. Especially, the size of +T_DATA+ may not be
* T_DATA may not be correct. * correct.
* *
* This method is not expected to work except C Ruby. * This method is only expected to work with C Ruby.
*/ */
static VALUE static VALUE
@ -201,26 +201,27 @@ total_i(void *vstart, void *vend, size_t stride, void *ptr)
* ObjectSpace.memsize_of_all([klass]) -> Integer * ObjectSpace.memsize_of_all([klass]) -> Integer
* *
* Return consuming memory size of all living objects. * Return consuming memory size of all living objects.
* If klass (should be Class object) is given, return the total
* memory size of instances of the given class.
* *
* Note that the returned size is incomplete. You need to deal with * If +klass+ (should be Class object) is given, return the total memory size
* this information as only a *HINT*. Especially, the size of * of instances of the given class.
* T_DATA may not be correct. *
* Note that the returned size is incomplete. You need to deal with this
* information as only a *HINT*. Especially, the size of +T_DATA+ may not be
* correct.
* *
* Note that this method does *NOT* return total malloc'ed memory size. * Note that this method does *NOT* return total malloc'ed memory size.
* *
* This method can be defined by the following Ruby code: * This method can be defined by the following Ruby code:
* *
* def memsize_of_all klass = false * def memsize_of_all klass = false
* total = 0 * total = 0
* ObjectSpace.each_object{|e| * ObjectSpace.each_object{|e|
* total += ObjectSpace.memsize_of(e) if klass == false || e.kind_of?(klass) * total += ObjectSpace.memsize_of(e) if klass == false || e.kind_of?(klass)
* } * }
* total * total
* end * end
* *
* This method is not expected to work except C Ruby. * This method is only expected to work with C Ruby.
*/ */
static VALUE static VALUE
@ -316,7 +317,7 @@ type2sym(enum ruby_value_type i)
* The contents of the returned hash is implementation defined. * The contents of the returned hash is implementation defined.
* It may be changed in future. * It may be changed in future.
* *
* This method is not expected to work except C Ruby. * This method is only expected to work with C Ruby.
*/ */
static VALUE static VALUE
@ -378,20 +379,21 @@ cn_i(void *vstart, void *vend, size_t stride, void *n)
* *
* Counts nodes for each node type. * Counts nodes for each node type.
* *
* This method is not for ordinary Ruby programmers, but for MRI developers * This method is only for MRI developers interested in performance and memory
* who have interest in MRI performance and memory usage. * usage of Ruby programs.
* *
* It returns a hash as: * It returns a hash as:
* {:NODE_METHOD=>2027, :NODE_FBODY=>1927, :NODE_CFUNC=>1798, ...}
* *
* If the optional argument, result_hash, is given, * {:NODE_METHOD=>2027, :NODE_FBODY=>1927, :NODE_CFUNC=>1798, ...}
* it is overwritten and returned.
* This is intended to avoid probe effect.
* *
* If the optional argument, result_hash, is given, it is overwritten and
* returned. This is intended to avoid probe effect.
*
* Note:
* The contents of the returned hash is implementation defined. * The contents of the returned hash is implementation defined.
* It may be changed in future. * It may be changed in future.
* *
* This method is not expected to work except C Ruby. * This method is only expected to work with C Ruby.
*/ */
static VALUE static VALUE
@ -575,31 +577,32 @@ cto_i(void *vstart, void *vend, size_t stride, void *data)
* call-seq: * call-seq:
* ObjectSpace.count_tdata_objects([result_hash]) -> hash * ObjectSpace.count_tdata_objects([result_hash]) -> hash
* *
* Counts objects for each T_DATA type. * Counts objects for each +T_DATA+ type.
* *
* This method is not for ordinary Ruby programmers, but for MRI developers * This method is only for MRI developers interested in performance and memory
* who interest on MRI performance. * usage of Ruby programs.
* *
* It returns a hash as: * It returns a hash as:
* {RubyVM::InstructionSequence=>504, :parser=>5, :barrier=>6,
* :mutex=>6, Proc=>60, RubyVM::Env=>57, Mutex=>1, Encoding=>99,
* ThreadGroup=>1, Binding=>1, Thread=>1, RubyVM=>1, :iseq=>1,
* Random=>1, ARGF.class=>1, Data=>1, :autoload=>3, Time=>2}
* # T_DATA objects existing at startup on r32276.
* *
* If the optional argument, result_hash, is given, * {RubyVM::InstructionSequence=>504, :parser=>5, :barrier=>6,
* it is overwritten and returned. * :mutex=>6, Proc=>60, RubyVM::Env=>57, Mutex=>1, Encoding=>99,
* This is intended to avoid probe effect. * ThreadGroup=>1, Binding=>1, Thread=>1, RubyVM=>1, :iseq=>1,
* Random=>1, ARGF.class=>1, Data=>1, :autoload=>3, Time=>2}
* # T_DATA objects existing at startup on r32276.
* *
* The contents of the returned hash is implementation defined. * If the optional argument, result_hash, is given, it is overwritten and
* It may be changed in future. * returned. This is intended to avoid probe effect.
*
* The contents of the returned hash is implementation specific and may change
* in the future.
* *
* In this version, keys are Class object or Symbol object. * In this version, keys are Class object or Symbol object.
*
* If object is kind of normal (accessible) object, the key is Class object. * If object is kind of normal (accessible) object, the key is Class object.
* If object is not a kind of normal (internal) object, the key is symbol * If object is not a kind of normal (internal) object, the key is symbol
* name, registered by rb_data_type_struct. * name, registered by rb_data_type_struct.
* *
* This method is not expected to work except C Ruby. * This method is only expected to work with C Ruby.
*/ */
static VALUE static VALUE
@ -712,24 +715,25 @@ collect_values(st_data_t key, st_data_t value, st_data_t data)
* [MRI specific feature] Return all reachable objects from `obj'. * [MRI specific feature] Return all reachable objects from `obj'.
* *
* This method returns all reachable objects from `obj'. * This method returns all reachable objects from `obj'.
* If `obj' has two or more references to the same object `x',
* then returned array only includes one `x' object.
* If `obj' is a non-markable (non-heap management) object such as
* true, false, nil, symbols and Fixnums (and Flonum) then it simply
* returns nil.
* *
* If `obj' has references to an internal object, then it returns * If `obj' has two or more references to the same object `x', then returned
* instances of `ObjectSpace::InternalObjectWrapper' class. * array only includes one `x' object.
* This object contains a reference to an internal object and
* you can check the type of internal object with `type' method.
* *
* If `obj' is instance of `ObjectSpace::InternalObjectWrapper' * If `obj' is a non-markable (non-heap management) object such as true,
* class, then this method returns all reachable object from * false, nil, symbols and Fixnums (and Flonum) then it simply returns nil.
* an internal object, which is pointed by `obj'. *
* If `obj' has references to an internal object, then it returns instances of
* ObjectSpace::InternalObjectWrapper class. This object contains a reference
* to an internal object and you can check the type of internal object with
* `type' method.
*
* If `obj' is instance of ObjectSpace::InternalObjectWrapper class, then this
* method returns all reachable object from an internal object, which is
* pointed by `obj'.
* *
* With this method, you can find memory leaks. * With this method, you can find memory leaks.
* *
* This method is not expected to work except in C Ruby. * This method is only expected to work except with C Ruby.
* *
* Example: * Example:
* ObjectSpace.reachable_objects_from(['a', 'b', 'c']) * ObjectSpace.reachable_objects_from(['a', 'b', 'c'])
@ -776,8 +780,6 @@ void Init_gc_hook(VALUE rb_mObjSpace);
/* /*
* Document-module: ObjectSpace * Document-module: ObjectSpace
* *
* == The objspace library
*
* The objspace library extends the ObjectSpace module and adds several * The objspace library extends the ObjectSpace module and adds several
* methods to get internal statistic information about * methods to get internal statistic information about
* object/memory management. * object/memory management.