sv: major refactor

- Internal data pointer is read only by default => any uses that
  require use of the pointer itself (freeing, mutating) must perform a
  cast.

- refactor tests to use some new sv macros and functions, and clean
  them up.

- slight cleanup of sv.c
This commit is contained in:
2026-02-10 17:40:51 +00:00
committed by oreodave
parent b646ae3f7e
commit 9f3bb57972
6 changed files with 12 additions and 15 deletions

View File

@@ -50,13 +50,13 @@ void vec_test_gen_substr(void)
{0, 16},
{0, 32},
{32, 64},
{0, ARRSIZE(text)},
{0, ARRSIZE(text) - 1},
};
for (u64 i = 0; i < ARRSIZE(tests); ++i)
{
struct Test test = tests[i];
const sv_t substr = SV((char *)text + test.start, test.size);
const sv_t substr = sv_substr(SV_AUTO(text), test.start, test.size);
const u64 size = test.size / 2;
lisp_t *lvec = make_vec(&system, size);