equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
120 int _free_list; |
120 int _free_list; |
121 |
121 |
122 // Requires that the caller hold a lock preventing parallel modifying |
122 // Requires that the caller hold a lock preventing parallel modifying |
123 // operations, and that the the table be less than completely full. If |
123 // operations, and that the the table be less than completely full. If |
124 // an entry for "region_ind" is already in the table, finds it and |
124 // an entry for "region_ind" is already in the table, finds it and |
125 // returns its address; otherwise returns "NULL." |
|
126 SparsePRTEntry* entry_for_region_ind(RegionIdx_t region_ind) const; |
|
127 |
|
128 // Requires that the caller hold a lock preventing parallel modifying |
|
129 // operations, and that the the table be less than completely full. If |
|
130 // an entry for "region_ind" is already in the table, finds it and |
|
131 // returns its address; otherwise allocates, initializes, inserts and |
125 // returns its address; otherwise allocates, initializes, inserts and |
132 // returns a new entry for "region_ind". |
126 // returns a new entry for "region_ind". |
133 SparsePRTEntry* entry_for_region_ind_create(RegionIdx_t region_ind); |
127 SparsePRTEntry* entry_for_region_ind_create(RegionIdx_t region_ind); |
134 |
128 |
135 // Returns the index of the next free entry in "_entries". |
129 // Returns the index of the next free entry in "_entries". |
156 |
150 |
157 bool contains_card(RegionIdx_t region_id, CardIdx_t card_index) const; |
151 bool contains_card(RegionIdx_t region_id, CardIdx_t card_index) const; |
158 |
152 |
159 void add_entry(SparsePRTEntry* e); |
153 void add_entry(SparsePRTEntry* e); |
160 |
154 |
161 SparsePRTEntry* get_entry(RegionIdx_t region_id); |
155 SparsePRTEntry* get_entry(RegionIdx_t region_id) const; |
162 |
156 |
163 void clear(); |
157 void clear(); |
164 |
158 |
165 size_t capacity() const { return _capacity; } |
159 size_t capacity() const { return _capacity; } |
166 size_t capacity_mask() const { return _capacity_mask; } |
160 size_t capacity_mask() const { return _capacity_mask; } |