equal
deleted
inserted
replaced
142 RSHashTable(size_t capacity); |
142 RSHashTable(size_t capacity); |
143 ~RSHashTable(); |
143 ~RSHashTable(); |
144 |
144 |
145 // Attempts to ensure that the given card_index in the given region is in |
145 // Attempts to ensure that the given card_index in the given region is in |
146 // the sparse table. If successful (because the card was already |
146 // the sparse table. If successful (because the card was already |
147 // present, or because it was successfullly added) returns "true". |
147 // present, or because it was successfully added) returns "true". |
148 // Otherwise, returns "false" to indicate that the addition would |
148 // Otherwise, returns "false" to indicate that the addition would |
149 // overflow the entry for the region. The caller must transfer these |
149 // overflow the entry for the region. The caller must transfer these |
150 // entries to a larger-capacity representation. |
150 // entries to a larger-capacity representation. |
151 bool add_card(RegionIdx_t region_id, CardIdx_t card_index); |
151 bool add_card(RegionIdx_t region_id, CardIdx_t card_index); |
152 |
152 |
199 _rsht(rsht) {} |
199 _rsht(rsht) {} |
200 |
200 |
201 bool has_next(size_t& card_index); |
201 bool has_next(size_t& card_index); |
202 }; |
202 }; |
203 |
203 |
204 // Concurrent accesss to a SparsePRT must be serialized by some external |
204 // Concurrent access to a SparsePRT must be serialized by some external mutex. |
205 // mutex. |
|
206 |
205 |
207 class SparsePRTIter; |
206 class SparsePRTIter; |
208 class SparsePRTCleanupTask; |
207 class SparsePRTCleanupTask; |
209 |
208 |
210 class SparsePRT VALUE_OBJ_CLASS_SPEC { |
209 class SparsePRT VALUE_OBJ_CLASS_SPEC { |
246 size_t occupied() const { return _next->occupied_cards(); } |
245 size_t occupied() const { return _next->occupied_cards(); } |
247 size_t mem_size() const; |
246 size_t mem_size() const; |
248 |
247 |
249 // Attempts to ensure that the given card_index in the given region is in |
248 // Attempts to ensure that the given card_index in the given region is in |
250 // the sparse table. If successful (because the card was already |
249 // the sparse table. If successful (because the card was already |
251 // present, or because it was successfullly added) returns "true". |
250 // present, or because it was successfully added) returns "true". |
252 // Otherwise, returns "false" to indicate that the addition would |
251 // Otherwise, returns "false" to indicate that the addition would |
253 // overflow the entry for the region. The caller must transfer these |
252 // overflow the entry for the region. The caller must transfer these |
254 // entries to a larger-capacity representation. |
253 // entries to a larger-capacity representation. |
255 bool add_card(RegionIdx_t region_id, CardIdx_t card_index); |
254 bool add_card(RegionIdx_t region_id, CardIdx_t card_index); |
256 |
255 |