| 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]; |
no test coverage detected