| 102 | | * ''small'' |
| 103 | | * ''large'' |
| | 104 | '''Small bitmaps.''' A small bitmap fits into a single word (the layout word of the info table), and looks like this: |
| | 105 | |
| | 106 | || Size (bits 0-4) || Bitmap (bits 5-31) || |
| | 107 | |
| | 108 | (for a 64-bit word size, the size is given 6 bits instead of 5). |
| | 109 | |
| | 110 | The size field gives the size of the payload, and each bit of the bitmap is 1 if the corresponding word of payload contains a pointer to a live object. |
| | 111 | |
| | 112 | The macros {{{MK_BITMAP}}}, {{{BITMAP_SIZE}}}, and {{{BITMAP_BITS}}} in [[GhcFile(includes/InfoTables.h)]] provide ways to conveniently operate on small bitmaps. |
| | 113 | |
| | 114 | '''Large bitmaps.''' If the size of the stack frame is larger than the 27 words that a small bitmap can describe, then the fallback mechanism is the large bitmap. A large bitmap is a separate structure, containing a single word size and a multi-word bitmap: see {{{StgLargeBitmap}}} in [[GhcFile(includes/InfoTables.h)]]. |
| | 115 | |