Reduce size of struct string_it_t on 64 bits

by storing an offset to the next character
instead of a pointer. An offset can be stored as a
BYTE instead of a PTR since UT-8 can use at most
4 characters per code point.
This commit is contained in:
Patrick Pelissier committed 2022-09-10 09:59:06 +02:00
1 parent 0b853c6d52
commit 442b0e7cea
2 files changed
+9 -7

No files matched your search

+1 -1
View File
@@ -46,7 +46,7 @@ static void test_utf8_basic(void)
assert (b == false);
assert (it->u == i);
assert (string_get_cref(it) == i);
assert (*it->next_ptr == 0);
assert (it->ptr[it->next_ptr] == 0);
assert (m_str1ng_utf8_length(buf) == 1);
assert (m_str1ng_utf8_valid_str_p(buf) == true);
/* Higher level access */