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

Function y_allocate

util/system/sys_alloc.h:8–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include <new>
7
8inline void* y_allocate(size_t n) {
9 void* r = malloc(n);
10
11 if (r == nullptr) {
12 throw std::bad_alloc();
13 }
14
15 return r;
16}
17
18inline void y_deallocate(void* p) {
19 free(p);

Callers 4

ReserveMethod · 0.85
ResizeMethod · 0.85
AllocateMethod · 0.85
Y_UNIT_TESTFunction · 0.85

Calls 2

mallocFunction · 0.50
bad_allocClass · 0.50

Tested by

no test coverage detected