Changes between Version 5 and Version 6 of Commentary/Rts/Storage
- Timestamp:
- 09/12/06 07:58:09 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Commentary/Rts/Storage
v5 v6 42 42 [[Image(sm-block.png)]] 43 43 44 We currently have megablocks of 1Mb in size (m = 20) with blocks of 4k in size (k = 12), and these sizes are easy to change ([[GhcFile(includes/Constants.h)]]). Block descriptors are currently 32 or 64 bytes depending on the word size (d = 5 or 6).44 We currently have megablocks of 1Mb in size (m = 20) with blocks of 4k in size (k = 12), and these sizes are easy to change ([[GhcFile(includes/Constants.h)]]). 45 45 46 So the block allocator has a little more structure: 46 Block descriptors are currently 32 or 64 bytes depending on the word size (d = 5 or 6). The block descriptor itself is 47 the structure `bdescr` defined in [[GhcFile(includes/Block.h)]], and that file also defines the `Bdescr()` macro. 48 49 The block allocator has a the following structure: 47 50 48 51 * At the bottom, talking to the OS, is the megablock allocator ([[GhcFile(rts/MBlock.c)]], [[GhcFile(rts/MBlock.h)]]). … … 57 60 * Sitting on top of the megablock allocator is the block layer ([[GhcFile(includes/Block.h)]], [[GhcFile(rts/BlockAlloc.c)]]). 58 61 This layer is responsible for providing: 59 * `void *allocGroup(int)` 60 * `void freeGroup(void *)` 61 These functions allocate and deallocate a block ''group'': a contiguous sequence of blocks (the degenerate, and common, case 62 is a single block). The block allocator is responsible for keeping track of free blocks. Currently it does this by 63 maintaining an ordered (by address) list of free blocks, with contiguous blocks coallesced. However this is certanly 64 not optimal, and has been shown to be a bottleneck in certain cases - improving this allocation scheme would be good. 62 {{{ 63 void *allocGroup(int) 64 void freeGroup(void *) 65 }}} 66 These functions allocate and deallocate a block ''group'': a contiguous sequence of blocks (the degenerate, and common, case 67 is a single block). The block allocator is responsible for keeping track of free blocks. Currently it does this by 68 maintaining an ordered (by address) list of free blocks, with contiguous blocks coallesced. However this is certanly 69 not optimal, and has been shown to be a bottleneck in certain cases - improving this allocation scheme would be good. 65 70 66 71 == The Garbage Collector ==
