MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxAllocateStringInfoCache

Function fxAllocateStringInfoCache

xs/sources/xsString.c:63–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61static txStringInfo* fxCacheStringInfo(txMachine* the, txString string);
62
63void fxAllocateStringInfoCache(txMachine* the)
64{
65 txStringInfoCache* cache = c_malloc(sizeof(txStringInfoCache) + ((mxStringInfoCacheLength - 1) * sizeof(txStringInfo)));
66 if (cache == C_NULL)
67 fxAbort(the, XS_NOT_ENOUGH_MEMORY_EXIT);
68 cache->count = mxStringInfoCacheLength;
69 cache->head = 0;
70 cache->tail = 0;
71 the->stringInfoCache = cache;
72}
73
74void fxFreeStringInfoCache(txMachine* the)
75{

Callers 1

fxAllocateFunction · 0.85

Calls 1

fxAbortFunction · 0.70

Tested by

no test coverage detected