From 78820e86c731656d1e36c091a36a5fa27cbb435a Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Wed, 23 Jul 2025 12:24:20 +0100 Subject: [PATCH] Update doc for ObjectSpace.memsize_of --- ext/objspace/objspace.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/objspace/objspace.c b/ext/objspace/objspace.c index 5e183e78ed..a61b1acbb4 100644 --- a/ext/objspace/objspace.c +++ b/ext/objspace/objspace.c @@ -38,10 +38,11 @@ * information as only a *HINT*. Especially, the size of +T_DATA+ may not be * correct. * - * This method is only expected to work with C Ruby. + * This method is only expected to work with CRuby. * - * From Ruby 2.2, memsize_of(obj) returns a memory size includes - * sizeof(RVALUE). + * From Ruby 3.2 with Variable Width Allocation, it returns the actual slot + * size used plus any additional memory allocated outside the slot (such + * as external strings, arrays, or hash tables). */ static VALUE