Added documentation for `mrb_singleton_class()`
MODIFY
include/mruby.h
include/mruby.h
@@ -362,7 +362,18 @@ MRB_API struct RClass *mrb_define_class_id(mrb_state *mrb, mrb_sym name, struct
MRB_API struct RClass *mrb_define_module(mrb_state *mrb, const char *name);
MRB_API struct RClass *mrb_define_module_id(mrb_state *mrb, mrb_sym name);
+/**
+ * Returns the singleton class of an object.
+ *
+ * Except that it raises a `TypeError` exception for immediate values.
+ */
MRB_API mrb_value mrb_singleton_class(mrb_state *mrb, mrb_value val);
+
+/**
+ * Returns the singleton class of an object.
+ *
+ * Except that it return `NULL` for immediate values.
+ */
MRB_API struct RClass *mrb_singleton_class_ptr(mrb_state *mrb, mrb_value val);
/**

MODIFY
src/class.c
src/class.c
@@ -1649,8 +1649,6 @@ mrb_mod_dummy_visibility(mrb_state *mrb, mrb_value mod)
return mod;
}
-/* returns mrb_class_ptr(mrb_singleton_class()) */
-/* except that it return NULL for immediate values */
MRB_API struct RClass*
mrb_singleton_class_ptr(mrb_state *mrb, mrb_value v)
{

Added documentation for `mrb_singleton_class()`