54
54
* ------------------------------------------------------------------------- */
56
// A count of blocks needs to store anything up to the size of memory
57
// divided by the block size. The safest thing is therefore to use a
58
// type that can store the full range of memory addresses,
59
// ie. StgWord. Note that we have had some tricky int overflows in a
60
// couple of cases caused by using ints rather than longs (e.g. #5086)
62
typedef StgWord memcount;
56
64
typedef struct nursery_ {
58
unsigned int n_blocks;
61
69
typedef struct generation_ {
62
70
unsigned int no; // generation number
64
72
bdescr * blocks; // blocks in this gen
65
unsigned int n_blocks; // number of blocks
66
unsigned int n_words; // number of used words
73
memcount n_blocks; // number of blocks
74
memcount n_words; // number of used words
68
76
bdescr * large_objects; // large objects (doubly linked)
69
unsigned int n_large_blocks; // no. of blocks used by large objs
70
unsigned int n_new_large_blocks; // count freshly allocated large objects
77
memcount n_large_blocks; // no. of blocks used by large objs
78
memcount n_new_large_blocks; // count freshly allocated large objects
72
unsigned int max_blocks; // max blocks
80
memcount max_blocks; // max blocks
73
81
bdescr *mut_list; // mut objects in this gen (not G0)
75
83
StgTSO * threads; // threads in this gen
98
106
// are copied into the following two fields. After GC, these blocks
100
108
bdescr * old_blocks; // bdescr of first from-space block
101
unsigned int n_old_blocks; // number of blocks in from-space
102
unsigned int live_estimate; // for sweeping: estimate of live data
109
memcount n_old_blocks; // number of blocks in from-space
110
memcount live_estimate; // for sweeping: estimate of live data
104
112
bdescr * saved_mut_list;
106
114
bdescr * part_blocks; // partially-full scanned blocks
107
unsigned int n_part_blocks; // count of above
115
memcount n_part_blocks; // count of above
109
117
bdescr * scavenged_large_objects; // live large objs after GC (d-link)
110
unsigned int n_scavenged_large_blocks; // size (not count) of above
118
memcount n_scavenged_large_blocks; // size (not count) of above
112
120
bdescr * bitmap; // bitmap for compacting collection