comparison src/share/vm/utilities/hashtable.hpp @ 6152:958bb4b7be49

Merge
author asaha
date Tue, 10 Apr 2012 10:42:34 -0700
parents b2cd0ee8f778
children e9140bf80b4a
comparison
equal deleted inserted replaced
6151:e778c29768e6 6152:958bb4b7be49
1 /* 1 /*
2 * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2003, 2012, 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.
181 181
182 void initialize(int table_size, int entry_size, int number_of_entries); 182 void initialize(int table_size, int entry_size, int number_of_entries);
183 183
184 // Accessor 184 // Accessor
185 int entry_size() const { return _entry_size; } 185 int entry_size() const { return _entry_size; }
186 int table_size() { return _table_size; }
187 186
188 // The following method is MT-safe and may be used with caution. 187 // The following method is MT-safe and may be used with caution.
189 BasicHashtableEntry* bucket(int i); 188 BasicHashtableEntry* bucket(int i);
190 189
191 // The following method is not MT-safe and must be done under lock. 190 // The following method is not MT-safe and must be done under lock.
193 192
194 // Table entry management 193 // Table entry management
195 BasicHashtableEntry* new_entry(unsigned int hashValue); 194 BasicHashtableEntry* new_entry(unsigned int hashValue);
196 195
197 public: 196 public:
197 int table_size() { return _table_size; }
198 void set_entry(int index, BasicHashtableEntry* entry); 198 void set_entry(int index, BasicHashtableEntry* entry);
199 199
200 void add_entry(int index, BasicHashtableEntry* entry); 200 void add_entry(int index, BasicHashtableEntry* entry);
201 201
202 void free_entry(BasicHashtableEntry* entry); 202 void free_entry(BasicHashtableEntry* entry);