| 116 | } |
| 117 | |
| 118 | const void *GetStringConstant(const char *data, asUINT length) |
| 119 | { |
| 120 | string str(data, length); |
| 121 | map_t::iterator it = stringCache.find(str); |
| 122 | if (it != stringCache.end()) |
| 123 | it->second++; |
| 124 | else |
| 125 | it = stringCache.insert(map_t::value_type(str, 1)).first; |
| 126 | |
| 127 | return reinterpret_cast<const void*>(&it->first); |
| 128 | } |
| 129 | |
| 130 | int ReleaseStringConstant(const void *str) |
| 131 | { |