Changes between Version 1 and Version 2 of Commentary/Rts/Word
- Timestamp:
- 09/06/06 04:16:25 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Commentary/Rts/Word
v1 v2 3 3 = GHC Commentary: The Word = 4 4 5 The most important type in the runtime is {{{StgWord}}}, defined in [[GhcFile(includes/StgTypes.h)]] 6 [[HelloWorld(foo,bar)]] 5 The most important type in the runtime is {{{StgWord}}}, defined in [[GhcFile(includes/StgTypes.h)]]. A word is defined to be the same size as a pointer on the current platform. All these types are interconvertible without losing information, and have the same size (as reported by {{{sizeof}}}): 7 6 7 {{{StgWord}}}:: 8 An unsiged integral type of word size 9 10 {{{StgInt}}}:: 11 A signed integral type of word size 12 13 {{{StgPtr}}}:: 14 Pointer to {{{StgWord}}} 15 16 The word is the basic unit of allocation in GHC: the heap and stack are both allocated in units of a word. Throughout the runtime we often use sizes that are in units of words, so as to abstract away from the real word size of the underlying architecture. 17 18 C-- only understands units of bytes, so we have various macros in [[GhcFile(includes/Cmm.h)]] to make manipulating things in units of words easier in {{{.cmm}}} files.
