MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / uriCompleteMemoryManager

Function uriCompleteMemoryManager

3rd/uriparser/src/UriMemory.c:264–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262
263
264int uriCompleteMemoryManager(UriMemoryManager * memory,
265 UriMemoryManager * backend) {
266 if ((memory == NULL) || (backend == NULL)) {
267 return URI_ERROR_NULL;
268 }
269
270 if ((backend->malloc == NULL) || (backend->free == NULL)) {
271 return URI_ERROR_MEMORY_MANAGER_INCOMPLETE;
272 }
273
274 memory->calloc = uriEmulateCalloc;
275 memory->reallocarray = uriEmulateReallocarray;
276
277 memory->malloc = uriDecorateMalloc;
278 memory->realloc = uriDecorateRealloc;
279 memory->free = uriDecorateFree;
280
281 memory->userData = backend;
282
283 return URI_SUCCESS;
284}
285
286
287

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68