MCPcopy Create free account
hub / github.com/Tencent/tgfx / AllocFunction

Function AllocFunction

src/pdf/DeflateStream.cpp:35–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33
34template <typename T>
35void* AllocFunction(void*, T items, T size) {
36 const size_t maxItems = SIZE_MAX / size;
37 if (maxItems < items) {
38 return nullptr;
39 }
40 return malloc(static_cast<size_t>(items) * static_cast<size_t>(size));
41}
42
43void FreeFunction(void*, void* address) {
44 free(address);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected