Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The return value of rb_class2name and rb_obj_classname #457

Closed
kubo opened this issue Sep 3, 2010 · 1 comment
Closed

The return value of rb_class2name and rb_obj_classname #457

kubo opened this issue Sep 3, 2010 · 1 comment
Labels
C-API Compatibility Function and feature compatibility with the MRI C-API

Comments

@kubo
Copy link
Contributor

kubo commented Sep 3, 2010

In MRI, rb_class2name and rb_obj_classname are declared as follows:

const char *rb_class2name(VALUE);
const char *rb_obj_classname(VALUE);

The return value must not be freed.

In Rubinius, they are declared as follows:

  /** C string representation of the class' name. You must free this string. */
  char*   rb_class2name(VALUE class_handle);

  /** String representation of the object's class' name. You must free this string. */
  char*   rb_obj_classname(VALUE object_handle);

They are noticed that "You must free this string." But it must not be freed as far as I checked.
The notice should be deleted and the return type should be changed to 'const char *' as MRI does.

@evanphx
Copy link
Member

evanphx commented Sep 4, 2010

Fix docs and const-ness in capi. Closed by 23a5f07.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-API Compatibility Function and feature compatibility with the MRI C-API
Projects
None yet
Development

No branches or pull requests

2 participants