Util (mallocHelper): implements ffMallocUsableSize and uses it

This commit is contained in:
Carter Li
2025-12-19 23:24:56 +08:00
committed by 李通洲
parent a9f43ff466
commit b64b93fc4a
5 changed files with 74 additions and 4 deletions
+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