MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/openvdb / alloc

Method alloc

openvdb_ax/openvdb_ax/codegen/String.h:108–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106 }
107
108 inline void alloc(const size_t size)
109 {
110 if (!this->isLocal()) std::free(this->ptr);
111 if (size > SSO_LENGTH-1) this->ptr = static_cast<char*>(std::malloc(size + 1));
112 else this->ptr = this->SSO;
113 this->ptr[size] = '\0';
114 this->len = size;
115 }
116
117 char* ptr = nullptr;
118 char SSO[SSO_LENGTH];

Callers 4

resetMethod · 0.95
axstringallocFunction · 0.45
axstringFunction · 0.45
operator+Method · 0.45

Calls 1

isLocalMethod · 0.95

Tested by

no test coverage detected