Util (mallocHelper): implements ffMallocUsableSize and uses it

This commit is contained in:
Carter Li authored and 李通洲 committed 2025-12-20 09:26:37 +08:00
1 parent a9f43ff466
commit b64b93fc4a
5 files changed
+74 -4

No files matched your search

+10 -1
View File
@@ -229,9 +229,18 @@ int main(void)
ffStrbufDestroy(&strbuf);
//initMoveS
{
char* heapStr = strdup("1234567890");
ffStrbufInitMoveS(&strbuf, heapStr);
VERIFY(ffStrbufEqualS(&strbuf, "1234567890"));
VERIFY(strbuf.allocated >= 11);
ffStrbufDestroy(&strbuf);
}
//initF
ffStrbufInitF(&strbuf, "%s", "1234567890123456789012345678901");
VERIFY(strbuf.allocated == 32);
VERIFY(strbuf.allocated >= 32);
VERIFY(ffStrbufEqualS(&strbuf, "1234567890123456789012345678901"));
//containC