Skip to content

Add ObjectSpace.memsize_of_all#5040

Merged
matz merged 3 commits into
mruby:masterfrom
RoryO:add-memsize-of-all
Jul 18, 2020
Merged

Add ObjectSpace.memsize_of_all#5040
matz merged 3 commits into
mruby:masterfrom
RoryO:add-memsize-of-all

Conversation

@RoryO

@RoryO RoryO commented Jul 18, 2020

Copy link
Copy Markdown
Contributor

Much simpler and I hope less error prone than before.

@@ -1,4 +1,3 @@
# coding: cp932

Copy link
Copy Markdown
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.

Comment thread mrbgems/mruby-objectspace/src/mruby_objectspace.c Outdated
@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

matz commented Jul 18, 2020

Copy link
Copy Markdown
Member

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

matz commented Jul 18, 2020

Copy link
Copy Markdown
Member

@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