diff options
author | Ludovic Courtès <ludo@gnu.org> | 2010-01-25 23:43:41 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2010-01-25 23:43:41 +0100 |
commit | bb190ddbba216251f2a8490adf9feadf0dbb7104 (patch) | |
tree | d08e7d6849fc0a7c29c032ab03bb6723f5f1e719 | |
parent | 227eff6a77dd58d64775fe91ae0f1596bfe3371b (diff) | |
download | guile-bb190ddbba216251f2a8490adf9feadf0dbb7104.tar.gz |
Add ASCII art representing the basic struct layout.
* libguile/struct.h: Add ASCII art version of the basic struct layout as
shown in Andy's diagrams.
-rw-r--r-- | libguile/struct.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/libguile/struct.h b/libguile/struct.h index 012d9b6e7..374a5ce74 100644 --- a/libguile/struct.h +++ b/libguile/struct.h @@ -33,9 +33,37 @@ in turn means we need support for changing the "class" (vtable) of an "instance" (struct). This necessitates some indirection and trickery. - I would like to write this all up here, but for now: + To summarize, structs are laid out this way: + + .-------. + | | + .----------------+---v------------- - + | vtable | data | slot0 | slot1 | + `----------------+----------------- - + | .-------. + | | | + .---v------------+---v------------- - + | vtable | data | slot0 | slot1 | + `----------------+----------------- - + | + v + + ... + .-------. + | | | + .---v------------+---v------------- - + .-| vtable | data | slot0 | slot1 | + | `----------------+----------------- - + | ^ + `-----' + + The DATA indirection (which corresponds to `SCM_STRUCT_DATA ()') is necessary + to implement class redefinition. + + For more details, see: http://wingolog.org/archives/2009/11/09/class-redefinition-in-guile + */ /* All vtables have the following fields. */ |