зеркало из https://github.com/github/ruby.git
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)
This commit is contained in:
Родитель
b49ec78fd0
Коммит
a0029ae2b6
|
@ -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.
|
||||
*/
|
||||
|
|
Загрузка…
Ссылка в новой задаче