< prev index next >

src/share/vm/gc/g1/sparsePRT.hpp

Print this page




  51   // in order to force correct alignment that could otherwise cause SIGBUS errors
  52   // when reading the member variables. This calculates the minimum number of card
  53   // array elements required to get that alignment.
  54   static const size_t card_array_alignment = sizeof(int) / sizeof(card_elem_t);
  55 
  56   RegionIdx_t _region_ind;
  57   int         _next_index;
  58   int         _next_null;
  59   // The actual cards stored in this array.
  60   // WARNING: Don't put any data members beyond this line. Card array has, in fact, variable length.
  61   // It should always be the last data member.
  62   card_elem_t _cards[card_array_alignment];
  63 
  64   // Copy the current entry's cards into "cards".
  65   inline void copy_cards(card_elem_t* cards) const;
  66 public:
  67   // Returns the size of the entry, used for entry allocation.
  68   static size_t size() { return sizeof(SparsePRTEntry) + sizeof(card_elem_t) * (cards_num() - card_array_alignment); }
  69   // Returns the size of the card array.
  70   static int cards_num() {
  71     return align_size_up(G1RSetSparseRegionEntries, card_array_alignment);
  72   }
  73 
  74   // Set the region_ind to the given value, and delete all cards.
  75   inline void init(RegionIdx_t region_ind);
  76 
  77   RegionIdx_t r_ind() const { return _region_ind; }
  78   bool valid_entry() const { return r_ind() >= 0; }
  79   void set_r_ind(RegionIdx_t rind) { _region_ind = rind; }
  80 
  81   int next_index() const { return _next_index; }
  82   int* next_index_addr() { return &_next_index; }
  83   void set_next_index(int ni) { _next_index = ni; }
  84 
  85   // Returns "true" iff the entry contains the given card index.
  86   inline bool contains_card(CardIdx_t card_index) const;
  87 
  88   // Returns the number of non-NULL card entries.
  89   inline int num_valid_cards() const { return _next_null; }
  90 
  91   // Requires that the entry not contain the given card index.  If there is




  51   // in order to force correct alignment that could otherwise cause SIGBUS errors
  52   // when reading the member variables. This calculates the minimum number of card
  53   // array elements required to get that alignment.
  54   static const size_t card_array_alignment = sizeof(int) / sizeof(card_elem_t);
  55 
  56   RegionIdx_t _region_ind;
  57   int         _next_index;
  58   int         _next_null;
  59   // The actual cards stored in this array.
  60   // WARNING: Don't put any data members beyond this line. Card array has, in fact, variable length.
  61   // It should always be the last data member.
  62   card_elem_t _cards[card_array_alignment];
  63 
  64   // Copy the current entry's cards into "cards".
  65   inline void copy_cards(card_elem_t* cards) const;
  66 public:
  67   // Returns the size of the entry, used for entry allocation.
  68   static size_t size() { return sizeof(SparsePRTEntry) + sizeof(card_elem_t) * (cards_num() - card_array_alignment); }
  69   // Returns the size of the card array.
  70   static int cards_num() {
  71     return align_up(G1RSetSparseRegionEntries, card_array_alignment);
  72   }
  73 
  74   // Set the region_ind to the given value, and delete all cards.
  75   inline void init(RegionIdx_t region_ind);
  76 
  77   RegionIdx_t r_ind() const { return _region_ind; }
  78   bool valid_entry() const { return r_ind() >= 0; }
  79   void set_r_ind(RegionIdx_t rind) { _region_ind = rind; }
  80 
  81   int next_index() const { return _next_index; }
  82   int* next_index_addr() { return &_next_index; }
  83   void set_next_index(int ni) { _next_index = ni; }
  84 
  85   // Returns "true" iff the entry contains the given card index.
  86   inline bool contains_card(CardIdx_t card_index) const;
  87 
  88   // Returns the number of non-NULL card entries.
  89   inline int num_valid_cards() const { return _next_null; }
  90 
  91   // Requires that the entry not contain the given card index.  If there is


< prev index next >