... | ... | @@ -598,7 +598,7 @@ To go the whole hog, you need to add a new closure type. This is considerably mo |
|
|
- [includes/rts/storage/ClosureTypes.h](/trac/ghc/browser/ghc/includes/rts/storage/ClosureTypes.h): Add the new closure type
|
|
|
- [includes/rts/storage/ClosureMacros.h](/trac/ghc/browser/ghc/includes/rts/storage/ClosureMacros.h): Add a case to `closure_sizeW` for your struct. However, if your structure is really simple (i.e. can be completely described by the info table, an entry here is not necessary.
|
|
|
- [includes/rts/storage/Closures.h](/trac/ghc/browser/ghc/includes/rts/storage/Closures.h): Define a struct for the closure, including the *header* as well as your payloads. Sometimes, you will have more than one info table per struct, e.g. if you have `DIRTY` and `CLEAN` variants. As a general rule, GC'd pointers should go before general fields.
|
|
|
- [utils/deriveConstants/DeriveConstants.hs](/trac/ghc/browser/ghc/utils/deriveConstants/DeriveConstants.hs): Tell the deriveConstants script to generate a bunch of accessors so you can manipulate the struct from C-- code.
|
|
|
- [utils/deriveConstants/Main.hs](/trac/ghc/browser/ghc/utils/deriveConstants/Main.hs): Tell the deriveConstants script to generate a bunch of accessors so you can manipulate the struct from C-- code.
|
|
|
- [rts/ClosureFlags.c](/trac/ghc/browser/ghc/rts/ClosureFlags.c): Update the closure flags (see [includes/rts/storage/InfoTables.h](/trac/ghc/browser/ghc/includes/rts/storage/InfoTables.h) for info on what the flags mean "Closure flags") and the sanity check at the bottom of the file
|
|
|
- [rts/Linker.c](/trac/ghc/browser/ghc/rts/Linker.c): Add your info tables so they are linked correctly
|
|
|
- [rts/Printer.c](/trac/ghc/browser/ghc/rts/Printer.c): Print out a description of the closure. You need to handle all of the info tables you defined.
|
... | ... | |