Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
38b07591
Commit
38b07591
authored
Jul 14, 2020
by
Rory O'Connell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify memsize_of documentation
parent
4d32c671
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
mrbgems/mruby-objectspace/src/mruby_objectspace.c
mrbgems/mruby-objectspace/src/mruby_objectspace.c
+10
-6
No files found.
mrbgems/mruby-objectspace/src/mruby_objectspace.c
View file @
38b07591
...
...
@@ -373,20 +373,24 @@ os_memsize_of_object(mrb_state* mrb, mrb_value obj, mrb_value recurse, mrb_int*
* ObjectSpace.memsize_of(obj, recurse: false) -> Numeric
*
* Returns the amount of heap memory allocated for object in size_t units.
* Not all objects cause additional heap allocations beyond their object pointer
* in the heap page and may return 0.
*
* The return value depends on the definition of size_t on that platform,
* therefore the value is not comparable across platform types.
*
* Immediate values such as integers, booleans, symbols and unboxed float numbers
* return 0. Additionally special objects which are small enough to fit inside an
* object
* pointer, termed embedded objects, also return 0. Strings and arrays
* below a compile-time defined size may be embedded.
* object
pointer, termed embedded objects, will return the size of the object pointer.
*
Strings and arrays
below a compile-time defined size may be embedded.
*
* Setting recurse: true descends into instance variables, array members,
* and hash values recursively, calculating the child objects and adding to
* the final sum.
* hash keys and hash values recursively, calculating the child objects and adding to
* the final sum. It avoids infinite recursion and over counting objects by
* internally tracking discovered object ids.
*
* MRB_TT_DATA objects aren't calculated beyond their original page slot. However,
* if the object implements a memsize method it will call that method and add the
* return value to the total. This provides an opportunity for C based data structures
* to report their memory usage.
*
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment