~ubuntu-branches/ubuntu/precise/ghc/precise

« back to all changes in this revision

Viewing changes to includes/rts/storage/GC.h

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2011-10-31 13:31:12 UTC
  • mfrom: (8.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20111031133112-qimkbmi8v4ajx5bc
Tags: 7.0.4-8ubuntu1
* Merge with Debian, remaining changes:
  + Pass --hash-style=both --no-copy-dt-needed-entries --as-needed to the
  linker.
* Use dh-autoreconf

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
 *
54
54
 * ------------------------------------------------------------------------- */
55
55
 
 
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)
 
61
 
 
62
typedef StgWord memcount;
 
63
 
56
64
typedef struct nursery_ {
57
65
    bdescr *       blocks;
58
 
    unsigned int   n_blocks;
 
66
    memcount       n_blocks;
59
67
} nursery;
60
68
 
61
69
typedef struct generation_ {
62
70
    unsigned int   no;                  // generation number
63
71
 
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
67
75
 
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
71
79
 
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)
74
82
 
75
83
    StgTSO *       threads;             // threads in this gen
98
106
    // are copied into the following two fields.  After GC, these blocks
99
107
    // are freed.
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
103
111
    
104
112
    bdescr *     saved_mut_list;
105
113
 
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
108
116
 
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
111
119
 
112
120
    bdescr *     bitmap;                // bitmap for compacting collection
113
121