summaryrefslogtreecommitdiff
path: root/ext/objspace
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-17 09:16:32 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-17 09:16:32 +0000
commitba49a1e025722a12a1cb58b5f90f7c548c91ba57 (patch)
tree7631dfff2b2176bc866d9e7d2e2626c9c07a66d9 /ext/objspace
parent089dd1a1ca85e172df435be82b5a5f0265ae7df4 (diff)
* ext/objspace/objspace.c: let rdoc know about objspace methods.
Specify 'objspace' should be required. See #8537. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/objspace')
-rw-r--r--ext/objspace/objspace.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/ext/objspace/objspace.c b/ext/objspace/objspace.c
index 0bdd626..2e51a3a 100644
--- a/ext/objspace/objspace.c
+++ b/ext/objspace/objspace.c
@@ -155,6 +155,7 @@ memsize_of(VALUE obj)
* T_DATA may not be correct.
*
* This method is not expected to work except C Ruby.
+ * You need to <code>require 'objspace'</code> to use this method.
*/
static VALUE
@@ -221,6 +222,7 @@ total_i(void *vstart, void *vend, size_t stride, void *ptr)
* end
*
* This method is not expected to work except C Ruby.
+ * You need to <code>require 'objspace'</code> to use this method.
*/
static VALUE
@@ -317,6 +319,7 @@ type2sym(enum ruby_value_type i)
* It may be changed in future.
*
* This method is not expected to work except C Ruby.
+ * You need to <code>require 'objspace'</code> to use this method.
*/
static VALUE
@@ -392,6 +395,7 @@ cn_i(void *vstart, void *vend, size_t stride, void *n)
* It may be changed in future.
*
* This method is not expected to work except C Ruby.
+ * You need to <code>require 'objspace'</code> to use this method.
*/
static VALUE
@@ -600,7 +604,7 @@ cto_i(void *vstart, void *vend, size_t stride, void *data)
* name, registered by rb_data_type_struct.
*
* This method is not expected to work except C Ruby.
- *
+ * You need to <code>require 'objspace'</code> to use this method.
*/
static VALUE
@@ -728,6 +732,7 @@ collect_values(st_data_t key, st_data_t value, st_data_t data)
* With this method, you can find memory leaks.
*
* This method is not expected to work except in C Ruby.
+ * You need to <code>require 'objspace'</code> to use this method.
*
* Example:
* ObjectSpace.reachable_objects_from(['a', 'b', 'c'])
@@ -789,7 +794,11 @@ void Init_gc_hook(VALUE rb_mObjSpace);
void
Init_objspace(void)
{
- VALUE rb_mObjSpace = rb_const_get(rb_cObject, rb_intern("ObjectSpace"));
+ VALUE rb_mObjSpace;
+#if 0
+ rb_mObjSpace = rb_define_module("ObjectSpace"); /* let rdoc know */
+#endif
+ rb_mObjSpace = rb_const_get(rb_cObject, rb_intern("ObjectSpace"));
rb_define_module_function(rb_mObjSpace, "memsize_of", memsize_of_m, 1);
rb_define_module_function(rb_mObjSpace, "memsize_of_all", memsize_of_all_m, -1);