From a0029ae2b68cec3a4cb298967afbc9192d331c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Tue, 26 Oct 2021 09:24:56 +0900 Subject: [PATCH] just another evidence that @shyouhei is an idiot [ci skip] (gdb) ptype/o struct RString /* offset | size */ type = struct RString { /* 0 | 16 */ struct RBasic { /* 0 | 8 */ VALUE flags; /* 8 | 8 */ const VALUE klass; /* total size (bytes): 16 */ } basic; /* 16 | 24 */ union { /* 24 */ struct { /* 16 | 8 */ long len; /* 24 | 8 */ char *ptr; /* 32 | 8 */ union { /* 8 */ long capa; /* 8 */ VALUE shared; /* total size (bytes): 8 */ } aux; /* total size (bytes): 24 */ } heap; /* 24 */ struct { /* 16 | 24 */ char ary[24]; /* total size (bytes): 24 */ } embed; /* XXX 8-byte padding */ /* total size (bytes): 24 */ } as; /* total size (bytes): 40 */ } (gdb) --- include/ruby/internal/core/rstring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ruby/internal/core/rstring.h b/include/ruby/internal/core/rstring.h index b7cf142156..fea2933a73 100644 --- a/include/ruby/internal/core/rstring.h +++ b/include/ruby/internal/core/rstring.h @@ -280,7 +280,7 @@ struct RString { /** * Embedded contents. When a string is short enough, it uses this area * to store the contents themselves. This was impractical in the 20th - * century, but these days 64 bit machines can typically hold 48 bytes + * century, but these days 64 bit machines can typically hold 24 bytes * here. Could be sufficiently large. In this case the length is * encoded into the flags. */