| 151 | } |
| 152 | |
| 153 | Ref<StaticString> StaticString::makeUTF8(size_t size) { |
| 154 | StaticStringAllocator allocator; |
| 155 | auto ref = allocator.allocate((size * sizeof(char)) + 1, size, Encoding::UTF8); |
| 156 | // Always null terminate UTF8 strings |
| 157 | ref->utf8Data()[size] = 0; |
| 158 | return ref; |
| 159 | } |
| 160 | |
| 161 | Ref<StaticString> StaticString::makeUTF16(size_t size) { |
| 162 | StaticStringAllocator allocator; |