MCPcopy Create free account
hub / github.com/catboost/catboost / main

Function main

util/memory/tempbuf.cpp:285–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285int main() {
286 const size_t num = 10000000;
287 size_t tmp = 0;
288
289 {
290 CTimer t("alloca");
291
292 for (size_t i = 0; i < num; ++i) {
293 tmp += (size_t)allocaFunc();
294 }
295 }
296
297 {
298 CTimer t("log buffer");
299
300 for (size_t i = 0; i < num; ++i) {
301 TTempBuf buf(LEN);
302
303 tmp += (size_t)buf.Data();
304 }
305 }
306
307 {
308 CTimer t("malloc");
309
310 for (size_t i = 0; i < num; ++i) {
311 void* ptr = malloc(LEN);
312
313 tmp += (size_t)ptr;
314
315 free(ptr);
316 }
317 }
318
319 return 0;
320}
321#endif

Callers

nothing calls this directly

Calls 4

allocaFuncFunction · 0.85
mallocFunction · 0.50
freeFunction · 0.50
DataMethod · 0.45

Tested by

no test coverage detected