Skip to content

Commit 9eac1c3

Browse files
committed
Update doc for ObjectSpace.memsize_of
1 parent 0f40860 commit 9eac1c3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

ext/objspace/objspace.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,14 @@
3838
* information as only a *HINT*. Especially, the size of +T_DATA+ may not be
3939
* correct.
4040
*
41-
* This method is only expected to work with C Ruby.
42-
*
43-
* From Ruby 2.2, memsize_of(obj) returns a memory size includes
44-
* sizeof(RVALUE).
41+
* This method is only expected to work with CRuby.
42+
*
43+
* From Ruby 2.2, memsize_of(obj) returns a memory size that includes
44+
* the slot size occupied by the object. Prior to Ruby 3.2, this was a
45+
* fixed size (sizeof(RVALUE)). From Ruby 3.2 with Variable Width
46+
* Allocation, this is the actual slot size used (1×, 2×, 4×, 8×, or
47+
* 16× BASE_SLOT_SIZE), plus any additional memory allocated outside
48+
* the slot (such as external strings, arrays, or hash tables).
4549
*/
4650

4751
static VALUE

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy