Skip to content

Add ObjectSpace.memsize_of_all #5040

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

Merged
merged 3 commits into from
Jul 18, 2020
Merged

Add ObjectSpace.memsize_of_all #5040

merged 3 commits into from
Jul 18, 2020

Conversation

RoryO
Copy link
Contributor

@RoryO RoryO commented Jul 18, 2020

Much simpler and I hope less error prone than before.

@@ -1,4 +1,3 @@
# coding: cp932
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sorry I think I introduced this initially. I did not catch that ruby-mode adds the encoding comment.

@matz matz merged commit 667ace2 into mruby:master Jul 18, 2020
matz added a commit that referenced this pull request Jul 18, 2020
`ObjectSpace.memsize_of_all` takes a class and count memory size of all
instances of the class and its subclasses (if any).
@matz
Copy link
Member

matz commented Jul 18, 2020

I updated a little.

  • memsize_of_all measures the size of all instances of the class and its subclass
  • the argument of memsize_of_all is optional

@matz
Copy link
Member

matz commented Jul 18, 2020

@RoryO Thank you for the contribution. Would you like to add your name to the AUTHORS file?
If so, send us PR.

@RoryO RoryO deleted the add-memsize-of-all branch July 18, 2020 23:39
matz added a commit that referenced this pull request Jul 19, 2020
matz added a commit that referenced this pull request Jul 19, 2020
The old code compiles only on `MRB_NO_BOXING`.
matz added a commit that referenced this pull request Jul 19, 2020
Those tests succeeds only on some configuration.
RoryO added a commit to RoryO/mruby that referenced this pull request Jul 19, 2020


Those methods are originally CRuby specific.

Co-authored-by: Yukihiro "Matz" Matsumoto <matz@ruby.or.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants