Brian Carlstrom | 7e93b50 | 2011-08-04 14:16:22 -0700 | [diff] [blame] | 1 | // Copyright 2011 Google Inc. All Rights Reserved. |
| 2 | |
| 3 | #ifndef ART_SRC_INTERN_TABLE_H_ |
| 4 | #define ART_SRC_INTERN_TABLE_H_ |
| 5 | |
| 6 | #include "unordered_map.h" |
| 7 | |
| 8 | #include "heap.h" |
| 9 | #include "object.h" |
| 10 | |
| 11 | namespace art { |
| 12 | |
| 13 | class InternTable { |
| 14 | public: |
| 15 | InternTable(); |
| 16 | String* Intern(int32_t utf16_length, const char* utf8_data); |
| 17 | void VisitRoots(Heap::RootVistor* root_visitor, void* arg); |
| 18 | |
| 19 | private: |
| 20 | typedef std::tr1::unordered_multimap<int32_t, String*> Table; |
| 21 | Table intern_table_; |
| 22 | Mutex* intern_table_lock_; |
| 23 | }; |
| 24 | |
| 25 | } // namespace art |
| 26 | |
| 27 | #endif // ART_SRC_CLASS_LINKER_H_ |