OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 // | 4 // |
5 #ifndef SRC_VM_VOID_HASH_TABLE_H_ | 5 #ifndef SRC_VM_VOID_HASH_TABLE_H_ |
6 #define SRC_VM_VOID_HASH_TABLE_H_ | 6 #define SRC_VM_VOID_HASH_TABLE_H_ |
7 | 7 |
8 #include "src/shared/globals.h" | 8 #include "src/shared/globals.h" |
9 #include "src/shared/assert.h" | 9 #include "src/shared/assert.h" |
10 | 10 |
11 namespace fletch { | 11 namespace dartino { |
12 | 12 |
13 class VoidHashTable { | 13 class VoidHashTable { |
14 public: | 14 public: |
15 explicit VoidHashTable(size_t value_size); | 15 explicit VoidHashTable(size_t value_size); |
16 ~VoidHashTable(); | 16 ~VoidHashTable(); |
17 | 17 |
18 char* Find(const void* key); | 18 char* Find(const void* key); |
19 | 19 |
20 const char* Find(const void* key) const { | 20 const char* Find(const void* key) const { |
21 return const_cast<VoidHashTable*>(this)->Find(key); | 21 return const_cast<VoidHashTable*>(this)->Find(key); |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 size_t entry_size_; // In bytes. | 191 size_t entry_size_; // In bytes. |
192 size_t mask_; // Capacity (in entries) - 1. | 192 size_t mask_; // Capacity (in entries) - 1. |
193 #ifdef DEBUG | 193 #ifdef DEBUG |
194 size_t mutations_; | 194 size_t mutations_; |
195 #endif | 195 #endif |
196 size_t size_; // Entries in use. | 196 size_t size_; // Entries in use. |
197 char* backing_; // The backing store of entries. | 197 char* backing_; // The backing store of entries. |
198 char* backing_end_; // The end of the backing store of entries. | 198 char* backing_end_; // The end of the backing store of entries. |
199 }; | 199 }; |
200 | 200 |
201 } // namespace fletch. | 201 } // namespace dartino. |
202 | 202 |
203 #endif // SRC_VM_VOID_HASH_TABLE_H_ | 203 #endif // SRC_VM_VOID_HASH_TABLE_H_ |
OLD | NEW |