| 237 | } |
| 238 | |
| 239 | char * StringHeapAllocator::intern(const char * str, uint64_t length) const { |
| 240 | if ( needIntern ) { |
| 241 | // Intern caps at 4GB string length — StrHashEntry stores length as uint32. |
| 242 | DAS_ASSERTF(length <= UINT32_MAX, "intern requires length < 4GB, got %llu", (unsigned long long)length); |
| 243 | auto it = internMap.find(StrHashEntry(str,uint32_t(length))); |
| 244 | return it != internMap.end() ? (char *)it->ptr : nullptr; |
| 245 | } else { |
| 246 | return nullptr; |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | void StringHeapAllocator::recognize ( char * str ) { |
| 251 | if ( !str ) return; |
no test coverage detected