MCPcopy Create free account
hub / github.com/Niko1221/Strata / alloc_log

Function alloc_log

engine/metal/src/gpu/runtime.cpp:271–276  ·  view source on GitHub ↗

STRATA_METAL_ALLOC_LOG=1: every allocation of 16 MB or more, with the running total (memory budgets on small Macs)

Source from the content-addressed store, hash-verified

269
270// STRATA_METAL_ALLOC_LOG=1: every allocation of 16 MB or more, with the running total (memory budgets on small Macs)
271void alloc_log(const char* what, size_t n) {
272 static const bool on = std::getenv("STRATA_METAL_ALLOC_LOG") != nullptr;
273 static std::atomic<uint64_t> tot{0};
274 const uint64_t t = tot += n;
275 if (on && n >= (16u << 20)) std::fprintf(stderr, "strata metal runtime: %s %.1f MB (total %.2f GB)\n", what, n / 1e6, t / 1e9);
276}
277
278Error new_alloc(void** p, size_t bytes, bool host) {
279 Runtime& r = rt();

Callers 2

new_allocFunction · 0.85
host_registerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected